Error creating virtualenv using python3 interpreter on Mac OS 10.9

Mac OS X version - 10.9.3 Protocol version - pip 1.5.6 from / Library / Python / 2.7 / site-packages / pip-1.5.6-py2.7.egg (python 2.7)

Hello!

When I try to make virtualenv using python3, I get this error:

air$ virtualenv python3.4 --python=/usr/local/bin/python3.4 Running virtualenv with interpreter /usr/local/bin/python3.4 Using base prefix '/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4' New python executable in python3.4/bin/python3.4 Not overwriting existing python script python3.4/bin/python (you must use python3.4/bin/python3.4) Installing setuptools, pip... Complete output from command /Users/***/.virt...hon3.4/bin/python3.4 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip: Traceback (most recent call last): File "<string>", line 1, in <module> File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl/pip/__init__.py", line 10, in <module> File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl/pip/util.py", line 18, in <module> File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl/pip/_vendor/distlib/version.py", line 14, in <module> File "/Library/Python/2.7/site-packages/virtualenv_support/pip-1.5.6-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 "/Library/Python/2.7/site-packages/virtualenv.py", line 2338, in <module> main() File "/Library/Python/2.7/site-packages/virtualenv.py", line 824, in main symlink=options.symlink) File "/Library/Python/2.7/site-packages/virtualenv.py", line 992, in create_environment install_wheel(to_install, py_executable, search_dirs) File "/Library/Python/2.7/site-packages/virtualenv.py", line 960, in install_wheel 'PIP_NO_INDEX': '1' File "/Library/Python/2.7/site-packages/virtualenv.py", line 902, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command /Users/***/.virt...hon3.4/bin/python3.4 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1 

Binaries:

 air$ which python python3 pip openssl virtualenv /usr/bin/python /usr/local/bin/python3 /usr/local/bin/pip /usr/bin/openssl /usr/local/bin/virtualenv 

Python3 was installed with brew install python3 pip was installed using sudo easy_install pip

PATH:

 air$ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin 

Please help me, what am I doing wrong?

I found this one related to my question, but how can I fix it on Mac OS?

UPD : More about the system:

 air$ pip3 Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in <module> from pip import main ImportError: No module named 'pip' air$ cat /usr/local/bin/pip3 #!/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/bin/python3.4 # -*- coding: utf-8 -*- import re import sys from pip import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(main()) 
+1
source share
2 answers

You must install openssl first, not python. Thus, openssl support will work (compiling python with ssl support if openssl is available during installation.).

+2
source

In addition to the Mathias answer, you also need to make sure that the following environment variables are set before compiling python3:

 LDFLAGS: -L/usr/local/opt/openssl/lib CPPFLAGS: -I/usr/local/opt/openssl/include 
0
source

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


All Articles