Python Error – urllib2 URLError: urlopen error unknown url type: https [Solved]

Updated on September 2, 2017

Question: I got this error urllib2.URLError: <urlopen error unknown url type: https> while installing packstack. After checking the program, I understood that the script is importing urllib library and uses urlretrieve function to fetch a file from https URL and it seems like the function is not able to fetch data from https URL. So I decided to edit the python script and renamed all https URL to http, but the error still remains. However the URL is valid, as I could open it successfully via web browser. Also, I have more than one version of Python installed (version 2.6 came with CentOS 6.4 and version 3.5 which was source installed), but not sure if that might be an issue. Can you help me to fix this issue?


There are chances that the Python installation might be broken. If you need to install multiple versions of Python, then it’s important to do it in a right way, else the entire Python will break and plus the system tools such as yum, setup etc…

python ssl support

Before that, you should check if the Python version that’s being used for installing packstack supports HTTPS. By default, Python will not understand HTTPS until and unless it’s complied with OpenSSL support.  You may need to refer this guide to compile Python with SSL support. Once you confirm that the Python is supporting HTTPS, try compiling packstack again and mostly likely the error will vanish.

Was this article helpful?

Related Articles

Comments Leave a Comment

Leave a Comment