Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sudo pip install django

Tags:

python

pip

django

So this is my first attempt at trying to install Django, and when I ran it, it successfully installed Django-1.7.3 but I received these warnings below. I wasn't able to find any information about it online so I was hoping someone could clarify what they mean, if I need to fix them, and how I could go about doing that?

Thanks! below is the output from my terminal

macbook:~ Asif$ sudo pip install Django
Password:
The directory '/Users/Asif/Library/Logs/pip' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
The directory '/Users/Asif/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 the -H flag.
The directory '/Users/Asif/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 the -H flag.
Collecting Django
  Downloading Django-1.7.3-py2.py3-none-any.whl (7.4MB)
    100% |################################| 7.4MB 2.3MB/s 
Installing collected packages: Django

Successfully installed Django-1.7.3
like image 436
Asif Avatar asked Jan 17 '15 22:01

Asif


1 Answers

These messages are just telling you that after issuing sudo the current user has changed to root and root isn't the owner of those directories or one of the parent directories.

sudo -H sets the $HOME environment variable to /root and would probably hide these but the way you did it is perfectly fine.

I'm pretty sure these messages are nothing to be concerned about, but its always good to see that people are reading them and making sure.

Also, to verify this, you can try:

$ sudo env | less

and

$ sudo -H env | less

and pay attention to the $HOME and $USER variables

like image 66
thedouglenz Avatar answered Oct 08 '22 11:10

thedouglenz