Virtualenv在创建环境时失败了

时间:2015-07-27 13:08:06

标签: python pip

我不知道原因,但函数mkvirtualenv以下列错误结束:

LEP:~ lep$ mkvirtualenv myenvironment
New python executable in myenvironment/bin/python
Installing setuptools, pip, wheel...
Complete output from command /Users/lep/.virtuale...vironment           /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 "/Users/lep/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-7.1.0-py2.py3-none-any.whl/pip/__init__.py", line 13, in <module>
  File "/Users/lep/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-7.1.0-py2.py3-none-any.whl/pip/utils/__init__.py", line 15, in <module>
 File "/Users/lep/anaconda/lib/python2.7/zipfile.py", line 6, in <module>
import io
 File "/Users/lep/anaconda/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: dlopen(/Users/lep/.virtualenvs/myenvironment/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException
  Referenced from: /Users/lep/.virtualenvs/myenvironment/lib/python2.7/lib-dynload/_io.so
  Expected in: dynamic lookup

----------------------------------------
...Installing setuptools, pip, wheel...done.
  Traceback (most recent call last):
  File "/Users/lep/anaconda/bin/virtualenv", line 11, in <module>
sys.exit(main())
  File "/Users/lep/anaconda/lib/python2.7/site-packages/virtualenv.py", line 832, in main
symlink=options.symlink)
  File "/Users/lep/anaconda/lib/python2.7/site-packages/virtualenv.py", line 1004, in create_environment
install_wheel(to_install, py_executable, search_dirs)
     File "/Users/lep/anaconda/lib/python2.7/site-packages/virtualenv.py", line 969, in install_wheel
'PIP_NO_INDEX': '1'
  File "/Users/lep/anaconda/lib/python2.7/site-packages/virtualenv.py", line 910, in call_subprocess
    % (cmd_desc, proc.returncode))
 OSError: Command /Users/lep/.virtuale...vironment/bin/python -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1

之前正在工作,现在我收到了这个错误。有人可以帮助我吗?

提前致谢,

Rhenan

2 个答案:

答案 0 :(得分:2)

看起来你正在使用Anaconda Python。您should be使用Conda执行此操作而不是virtenv。

尝试:

LEP:~ lep$ conda create --name myenvironment

答案 1 :(得分:1)

尝试降级到python版本2.7.9

conda install python=2.7.9

感谢the GitHub conda issues section

中的人们

附录:谢谢,Josh Trii Johnston他的评论基本上说我做了同样的事情......我之前没有看到。