On an Ubuntu system, I am trying to test a python package with tox and multiple python versions. One of the python versions I'm trying to test is the 64-bit Anaconda Python 2.7. Before I can start testing with Tox, I first need to get virtualenv to work with Anaconda, because Tox uses virtualenv internally.
As you can see, virtualenv is already installed in my Anaconda environment:
$ conda install virtualenv Fetching package metadata: .... Solving package specifications: ....................
However, an attempt to create a virtual environment fails:
$ mkvirtualenv test New python executable in test/bin/python Installing setuptools, pip... Complete output from command /home/me/....envs/test/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip: Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/me/.local/lib/python2.7/site-packages/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl/pip/__init__.py", line 9, in <module> File "/home/me/.local/lib/python2.7/site-packages/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl/pip/log.py", line 8, in <module> File "/home/me/.local/lib/python2.7/site-packages/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl/pip/backwardcompat/__init__.py", line 66, in <module> File "/home/me/software/anaconda/lib/python2.7/urllib2.py", line 93, in <module> import hashlib File "/home/me/software/anaconda/lib/python2.7/hashlib.py", line 138, in <module> _hashlib.openssl_md_meth_names) AttributeError: 'module' object has no attribute 'openssl_md_meth_names' ---------------------------------------- ...Installing setuptools, pip...done. Traceback (most recent call last): File "/home/me/software/anaconda/bin/virtualenv", line 6, in <module> sys.exit(main()) File "/home/me/.local/lib/python2.7/site-packages/virtualenv.py", line 824, in main symlink=options.symlink) File "/home/me/.local/lib/python2.7/site-packages/virtualenv.py", line 992, in create_environment install_wheel(to_install, py_executable, search_dirs) File "/home/me/.local/lib/python2.7/site-packages/virtualenv.py", line 960, in install_wheel 'PIP_NO_INDEX': '1' File "/home/me/.local/lib/python2.7/site-packages/virtualenv.py", line 902, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command /home/me/....envs/test/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1
How to get virtualenv to work with Anaconda?