Python 如何在El Capitan上安装VirtualNVRapper?
我已经在我的mac上安装了pip和virtualenv,但是我在尝试安装VirtualEnvrapper时遇到了问题。当我尝试重新安装时,它会显示: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
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。