我正在按照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