如何在MacOS High Sierra中使用pip安装virtualenv?

时间:2017-10-03 19:37:35

标签: macos tensorflow virtualenv macos-sierra tensorflow-gpu

我以前安装virtualenv的命令: -

sudo pip install virtualenv

结果: -

The directory '/Users/apple/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/apple/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: virtualenv in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

2 个答案:

答案 0 :(得分:2)

sudo -H pip install virtualenv

(kodlan字面意思不是foo ...)

答案 1 :(得分:0)

如果您在尝试运行pip时试图摆脱此错误,只需添加-H标志:

sudo -H pip install foo