I installed virtualenv on ubuntu. However, when I try to create a virtualenv I get an error. My Zenv folder does not contain "activate". How can I fix it? I would do this frequently. This is the first time I get this error.
ubuntu@ip-172-31-24-181:~$ virtualenv Zenv
New python executable in /home/ubuntu/Zenv/bin/python
Installing setuptools, pip, wheel...
Complete output from command /home/ubuntu/Zenv/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/__init__.py", line 15, in <module>
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/vcs/mercurial.py", line 9, in <module>
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/download.py", line 38, in <module>
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/requests/__init__.py", line 58, in <module>
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/requests/utils.py", line 26, in <module>
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/requests/compat.py", line 7, in <module>
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-8.0.2-py2.py3-none-any.whl/pip/_vendor/requests/packages/__init__.py", line 29, in <module>
ImportError: No module named urllib3
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/home/ubuntu/anaconda/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv.py", line 703, in main
symlink=options.symlink)
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv.py", line 904, in create_environment
download=download,
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv.py", line 861, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env)
File "/home/ubuntu/anaconda/lib/python2.7/site-packages/virtualenv.py", line 781, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/ubuntu/Zenv/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1
In my case, I had the python version from my anaconda that was interfering with the python I had in /usr/bin. This worked for me:
virtualenv my-virtualenv -p /usr/bin/python
'virtualenv venv' may use python in anaconda, which may cause the problem.
'virtualenv venv -p /usr/bin/python' may meet this problem, but it uses python default in your system, not python in anaconda.
so you can use 'pip install virtualenv' before you install anaconda, and Do not install virtualenv in anaconda.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With