Getting ImportError: Cannot import name HTTPSHandler during virtual environment creation

I have a Raspbery Pi that I upgraded to Python 3.3.3 by doing the following:

sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev wget http://www.python.org/ftp/python/3.3.3/Python-3.3.3.tar.bz2 tar jxf ./Python-3.3.3.tar.bz2 cd ./Python-3.3.3 ./configure --prefix=/opt/python3.3.3 make && sudo make install 

But after execution: virtualenv -p /opt/python3.3.3/bin/python3.3 python3.3.3

I get this error message:

 Running virtualenv with interpreter /opt/python3.3.3/bin/python3.3 Using base prefix '/opt/python3.3.3' New python executable in python3.3.3/bin/python3.3 Also creating executable in python3.3.3/bin/python Installing setuptools, pip... Complete output from command /home/pi/venv/python3.3.3/bin/python3.3 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip: Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/__init__.py", line 10, in <module> File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/util.py", line 18, in <module> File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/_vendor/distlib/version.py", line 14, in <module> File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/_vendor/distlib/compat.py", line 66, in <module> ImportError: cannot import name HTTPSHandler ---------------------------------------- ...Installing setuptools, pip...done. Traceback (most recent call last): File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 2338, in <module> main() File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 824, in main symlink=options.symlink) File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 992, in create_environment install_wheel(to_install, py_executable, search_dirs) File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 960, in install_wheel 'PIP_NO_INDEX': '1' File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 902, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command /home/pi/venv/python3.3.3/bin/python3.3 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1 
+4
source share
1 answer

I also had this problem when creating 2.7, as Giorgio mentioned. user3301335 is exactly right - when building python there are additional modules that can be compiled with library dependencies.

To save time searching for comments, the solution is to install the SSL development kit on your operating system. The APT package is called something like libssl-dev ; on Red Hat, it looks like openssl-devel .

+1
source

Source: https://habr.com/ru/post/1207526/


All Articles