我正在按照Django的設置教程,我必須在我的文件夾中設置一個虛擬環境。我沒有virtualenv
,所以我也sudo pip install virtualenv
和得到這個消息時,它被安裝後:Django VirtualEnv設置 - 'setuptools pip wheel失敗,錯誤代碼-11'
Chriss-MacBook-Air:trydjango18 cnowak7$ sudo pip install virtualenv
The directory '/Users/cnowak7/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/cnowak7/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting virtualenv
Downloading virtualenv-13.1.0-py2.py3-none-any.whl (1.7MB)
100% |████████████████████████████████| 1.7MB 120kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-13.1.0
在此之後,我試圖創建一個虛擬環境,比如在virtualenv .
教程和得到這個異常輸出:
Chriss-MacBook-Air:trydjango18 cnowak7$ virtualenv .
Using base prefix '/Users/cnowak7/anaconda'
New python executable in ./bin/python3
Also creating executable in ./bin/python
Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/Users/cnowak7/anaconda/bin/virtualenv", line 11, in <module>
sys.exit(main())
File "/Users/cnowak7/anaconda/lib/python3.4/site-packages/virtualenv.py", line 832, in main
symlink=options.symlink)
File "/Users/cnowak7/anaconda/lib/python3.4/site-packages/virtualenv.py", line 1004, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/Users/cnowak7/anaconda/lib/python3.4/site-packages/virtualenv.py", line 969, in install_wheel
'PIP_NO_INDEX': '1'
File "/Users/cnowak7/anaconda/lib/python3.4/site-packages/virtualenv.py", line 910, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/cnowak7/Deskt...django18/bin/python3 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code -11
於是,我就看看這個錯誤會影響我的教學進度,所以當我跑source bin/activate
,我得到這個錯誤:
Chriss-MacBook-Air:trydjango18 cnowak7$ source bin/activate
-bash: bin/activate: No such file or directory
我試着卸載並重新安裝了pip
和virtualenv
,但這個問題依然存在。這可能是因爲我有我的Anaconda文件夾目錄中的每一個?任何幫助或建議,將不勝感激。謝謝。
試試這個:'pip install setuptools --no-use-wheel --upgrade' – doniyor
我試過這個沒有運氣。這是我得到的錯誤: – Rafi
Chriss-MacBook-Air:〜cnowak7 $ pip install setuptools --no-use-wheel --upgrade Traceback(最近調用最後一次): 文件「/ Users/cnowak7/anaconda/bin/pip「,第5行, from pkg_resources import load_entry_point ImportError:沒有名爲'pkg_resources'的模塊 –
Rafi