Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在El Capitan上安装VirtualNVRapper?_Python_Bash_Macos_Pip_Virtualenvwrapper - Fatal编程技术网

Python 如何在El Capitan上安装VirtualNVRapper?

Python 如何在El Capitan上安装VirtualNVRapper?,python,bash,macos,pip,virtualenvwrapper,Python,Bash,Macos,Pip,Virtualenvwrapper,我已经在我的mac上安装了pip和virtualenv,但是我在尝试安装VirtualEnvrapper时遇到了问题。当我尝试重新安装时,它会显示: The directory '/Users/mhcadmin/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

我已经在我的mac上安装了pip和virtualenv,但是我在尝试安装VirtualEnvrapper时遇到了问题。当我尝试重新安装时,它会显示:

The directory '/Users/mhcadmin/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/mhcadmin/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): stevedore in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from stevedore->virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): pbr>=1.6 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from stevedore->virtualenvwrapper)
但是当我运行mkvirtualenv时,我得到以下消息

mhcadmin$ mkvirtualenv 

-bash: mkvirtualenv: command not found
我也试着跟随这个帖子 但它不起作用

这就是我的bash_配置文件的外观:

# Python's virtualenvwrapper-RELATED

export WORKON_HOME=/Users/mhcadmin/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh
export WORKON_HOME=~/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh
这就是我的bashrc的样子:

# Python's virtualenvwrapper-RELATED

export WORKON_HOME=/Users/mhcadmin/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh
export WORKON_HOME=~/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh
我明白了。这里

我发现我可以通过键入来访问usr/local/bin

open -a Finder /usr/local/bin
然后,我使用

which virtualenvwrapper.sh
然后我把virtualnvwrapper.sh复制到usr/local/bin中,我就明白了。这里

我发现我可以通过键入来访问usr/local/bin

open -a Finder /usr/local/bin
然后,我使用

which virtualenvwrapper.sh

然后我将virtualnvwrapper.sh复制到usr/local/bin

中,您提供的链接信息非常丰富。它甚至包括苹果对python开发者的立场。说到这里,不要尝试在苹果提供的python上安装virtualenv。为此,我使用了miniconda,这是virtualenv更好的替代品。您是否接受了错误消息的建议并使用了
sudo-H
?@alvits OP没有安装在苹果提供的Python上,他们使用的是Python.org版本。@MattDMo,我尝试过使用sudo-H,但没有修复它。您提供的链接信息非常丰富。它甚至包括苹果对python开发者的立场。说到这里,不要尝试在苹果提供的python上安装virtualenv。为此,我使用了miniconda,这是virtualenv更好的替代品。您是否接受了错误消息的建议并使用了
sudo-H
?@alvits OP没有安装在苹果提供的Python上,他们使用的是Python.org版本。@MattDMo,我尝试过使用sudo-H,但它没有修复它,结果是我的virtualenvwrapper.sh位于Python框架文件夹中,而不是usr/local/bin。结果是我的virtualenvwrapper.sh位于Python框架文件夹中,而不是usr/local/bin。