What does this warning mean? I got it when executing following command using root at amazon ec2 Ubuntu 14.04 LTS instance:
$ pip install https://github.com/troeger/opensubmit/archive/0.6.2.tar.gz The directory '/home/ubuntu/.cache/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 '/home/ubuntu/.cache/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.
Here is Solutions:
We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.
Well, your question partly has an answer in the quote:
You are using
sudo to gain root permissions, but the way you are using
sudo does not adjust the value of
$HOME, so pip tries to install into the pip directory of the user who invoked
This might cause problems if the actual user would want to remove or change the installed modules, therefore the warning.
To avoid the warning and unless you don’t have to, use pip without root/sudo or invoke sudo as
sudo -H which will set
$HOME to the user you are changing to, in this case
This message hints at the fact that you might have executed pip earlier using sudo for the then-issued command.
sudo pip install https://github.com/troeger/opensubmit/archive/0.6.2.tar.gz
Per default, sudo does not change the environment variable
HOME and therefore
sudo env | grep HOME is printing
-H to the sudo command changes this behaviour and it prints
To solve your problem you should make sure every folder in this path
/home/ubuntu/.cache/pip/http (except / and /home) is owned by
sudo -H chown -R ubuntu: /home/ubuntu/.cache
Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂