Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The directory 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. #215

Open
bryanbeshore opened this issue Nov 24, 2016 · 4 comments

Comments

@bryanbeshore
Copy link

I am receiving the following message when trying to install virtualenv via: sudo pip install virtualenv

Bryans-MacBook-Pro:/ BryanB$ sudo pip install virtualenv
The directory '/Users/BryanB/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/BryanB/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.

Tried sudo -H pip install virtualenv

Result
Requirement already satisfied: virtualenv in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

I am unsure how to resolve this issue.

@merwok
Copy link
Contributor

merwok commented Nov 24, 2016

Is it an issue? Virtualenv is installed in your framework Python site-packages directory. If your $PATH contains the bin directory of that installation, you should be able to run the virtualenv command now.

@bryanbeshore
Copy link
Author

When trying to run $ mkvirtualenv TestEnv

Result -bash: mkvirtualenv: command not found

Per this tutorial: http://newcoder.io/begin/setup-your-machine/, my response should be something like:

$ mkvirtualenv TestEnv
Installing
distribute..........................................
....................................................
....................................................
...............................done.
virtualenvwrapper.user_scripts Creating /Users/lynnroot/Envs/TestEnv/bin/predeactivate
virtualenvwrapper.user_scripts Creating /Users/lynnroot/Envs/TestEnv/bin/postdeactivate
virtualenvwrapper.user_scripts Creating /Users/lynnroot/Envs/TestEnv/bin/preactivate
virtualenvwrapper.user_scripts Creating /Users/lynnroot/Envs/TestEnv/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/lynnroot/Envs/TestEnv/bin/get_env_details

And should have a virtual environment called TestEnv, which I should see (TestEnv) before your prompt:

(TestEnv) $

But, obviously I am not... Not sure why. First time doing much of anything with Python. Would like to test out writing scrapers

Thanks

@merwok
Copy link
Contributor

merwok commented Nov 24, 2016

mkvirtualenv is a command provided by virtualenvwrapper, a set of helpers built on top of virtualenv. Either run pip install virtualenvwrapper (no need for sudo), or use “bare” virtualenv commands instead of mkvirtualenv.

@dhruvhacks
Copy link

This happens when someone installs a package via pip using sudo in a virtualenv.
You can update the permissions by using following commands as referred in link-

$ sudo chown -R USERNAME /Users/USERNAME/Library/Logs/pip
$ sudo chown -R USERNAME /Users/USERNAME/Library/Caches/pip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants