如何在El Capitan上安装virtualenvwrapper?

时间:2016-07-08 20:03:00

标签: python bash macos pip virtualenvwrapper

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

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

我也尝试过这篇文章 Installing virtualenv virtualenvwrapper with pip on osx 10.11.1 但它不起作用。

这就是我的bash_profile的样子:

# Python's virtualenvwrapper-RELATED

export WORKON_HOME=/Users/mhcadmin/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh

这就是我的bashrc的样子:

export WORKON_HOME=~/.virtualenvs

source /usr/local/bin/virtualenvwrapper.sh

1 个答案:

答案 0 :(得分:1)

想出来。在这里

http://forums.macrumors.com/threads/how-do-you-find-folders-like-usr-local-bin-in-finder.99576/

我发现我可以通过输入

来访问usr / local / bin
open -a Finder /usr/local/bin

然后我使用

找到了virtualenvwrapper.sh
which virtualenvwrapper.sh

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