How to install virtualenv by using pip in MacOS Hi

2019-09-20 16:51发布

问题:

Command which i used to install virtualenv:-

sudo pip install virtualenv

Result:-

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

回答1:

sudo -H pip install virtualenv

(kodlan didn't literally mean foo...)



回答2:

If you're trying to get rid of this error when trying to run pip just add -H flag:

sudo -H pip install foo