2015-10-13 84 views
0

我無法運行的virtualenv,我不斷收到此相同的錯誤代碼:「setuptools的PIP輪失敗,錯誤代碼1」VIRTUALENV導致setuptools的錯誤

我看到一些網頁談論如何,這是之間的差異不同版本的setuptools,但是我已經卸載並重新安裝了幾個版本的virtualenv和setuptools,但沒有任何結果。有人知道這裏發生了什麼?

Roberts-MacBook-Air:script Rob$ virtualenv venv 
New python executable in venv/bin/python 
Installing setuptools, pip, wheel... 
    Complete output from command /Users/Rob/Seedstages/script/venv/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/Rob/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/__init__.py", line 13, in <module> 
    File "/Users/Rob/anaconda/lib/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/utils/__init__.py", line 15, in <module> 
    File "/Users/Rob/anaconda/lib/python2.7/zipfile.py", line 6, in <module> 
    import io 
    File "/Users/Rob/anaconda/lib/python2.7/io.py", line 51, in <module> 
    import _io 
ImportError: dlopen(/Users/Rob/Seedstages/script/venv/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException 
    Referenced from: /Users/Rob/Seedstages/script/venv/lib/python2.7/lib-dynload/_io.so 
    Expected in: dynamic lookup 

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

回答

1

我要說的是,蟒蛇導致衝突,但更具體,它看起來彷彿蟒蛇的virtualenv中的問題。在我的MacBook上運行which virtualenv(我遇到同樣的問題)在運行linux系統時產生/Users/me/anaconda/bin/virtualenv我剛剛在收益率/usr/local/bin/virtualenv上測試了此項。

因此,在OS X上,我使用/usr/local/bin/pip install virtualenv下載了virtualenv。這不創建的virtualenv二進制文件(或者它沒有對我來說)的路徑文件夾中,所以我必須鍵入此痛苦很長的命令:

sudo /usr/local/bin/python ... {到virtualenv.py路徑系統蟒蛇的網站包文件夾} new_env

而且做到了。但這很荒謬。沒有人願意這樣做 - 即使創建鏈接仍然會在你不需要的時候破解它。

根據on this very subject的ContinuumIO GitHub的頁面,在virtualenv envsource /bin/activate命令替換爲conda create -n env python=2.7source activate env

在我的macbook上測試(在OS Yosemite上運行Anaconda2 v4),結果就出來了。