简体   繁体   English

Django VirtualEnv设置-'setuptools pip wheel失败,错误代码为-11'

[英]Django VirtualEnv Setup - 'setuptools pip wheel failed with error code -11'

I'm following a setup tutorial for Django where I have to set up a virtual environment in my folder. 我正在遵循Django的设置教程,在该教程中,必须在文件夹中设置虚拟环境。 I didn't have virtualenv , so I did sudo pip install virtualenv and got this message after it was installed: 我没有virtualenv ,所以我做了sudo pip install virtualenv并在安装后得到了此消息:

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

After this, I tried creating a virtual environment like in the tutorial with virtualenv . 之后,我尝试使用virtualenv .在本教程中创建一个虚拟环境virtualenv . and got this abnormal output: 并得到以下异常输出:

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

So I tried to see if this error would affect my progress in the tutorial, so when I ran source bin/activate , I got this error: 因此,我尝试查看此错误是否会影响本教程的进度,因此当我运行source bin/activate ,出现了以下错误:

Chriss-MacBook-Air:trydjango18 cnowak7$ source bin/activate
-bash: bin/activate: No such file or directory

I tried uninstalling and reinstalling pip and virtualenv , but this problem persists. 我尝试卸载并重新安装pipvirtualenv ,但是此问题仍然存在。 Is this possibly because I have every in my Anaconda folder directory? 这可能是因为我的Anaconda文件夹目录中有每个目录吗? Any help or advice would be appreciated. 任何帮助或建议,将不胜感激。 Thanks. 谢谢。

I ended up solving this problem by going to www.brew.sh and running the following command in my Terminal: 我最终通过访问www.brew.sh并在终端中运行以下命令来解决此问题:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

From my understanding, it basically gave me all the packages and libraries that I was missing that Apple didn't originally give me. 据我了解,它基本上给了我苹果最初没有给我的所有软件包和库。 I hope this helps for anyone else who was experiencing this same problem. 我希望这对遇到同样问题的其他人有所帮助。

try this: 尝试这个:

sudo easy_install pip

and then: 接着:

virtualenv your_virtualenv

I had the same problem as @Rafi. 我和@Rafi有同样的问题。 Upon examining error messages after executing 执行后检查错误消息

virtualenv .

, I got a clue from this error message: ,我从此错误消息中得到了一个线索:

dyld: Library not loaded: @rpath/libpython3.6m.dylib

Did some search and found out it means bad interactions between virtualenv and Anaconda at this link . 做了一些搜索和发现它是指在virtualenv中和巨蟒之间的相互作用不好这个链接 This simple solution solved my problem: 这个简单的解决方案解决了我的问题:

pip uninstall virtualenv
conda install virtualenv

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用virtualenv和错误消息:-setuptools pip wheel失败,错误代码为1 - Using virtualenv and error message: - setuptools pip wheel failed with error code 1 Virtualenv OSError - setuptools pip wheel 失败,错误代码为 1 - Virtualenv OSError - setuptools pip wheel failed with error code 1 setuptools pip 轮失败,错误代码为 2 - setuptools pip wheel failed with error code 2 Setuptools pip wheel失败,错误代码为2(Pycharm) - Setuptools pip wheel failed with error code 2 (Pycharm) 无法使用“setuptools pip wheel failed with error code 1”创建虚拟环境 - Cannot create virtual environment with "setuptools pip wheel failed with error code 1" “ pipenv安装”导致“ OSError:命令…/ python2.7-setuptools pip wheel失败,错误代码为1” - “pipenv install” causes “OSError: Command …/python2.7 - setuptools pip wheel failed with error code 1” 虚拟环境将无法运行-setuptools pip失败,错误代码为2 - Virtual env won't run - setuptools pip failed with error code 2 pip install --upgrade pip 和 pip install --upgrade setuptools 均失败,错误代码为 1 - pip install --upgrade pip and pip install --upgrade setuptools both failed with error code 1 Pythonsetuptools pkg_resources pip wheel失败,错误代码为1 [错误] - Pythonsetuptools pkg_resources pip wheel failed with error code 1 [Error] pip install scipy,失败,错误代码-11 - pip install scipy, failed with error code -11
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM