简体   繁体   English

sudo pip install django

[英]sudo pip install 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. 所以这是我尝试安装Django的第一次尝试,当我运行它时,它成功安装了Django-1.7.3但我在下面收到了这些警告。 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

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 ,当前用户已更改为rootroot不是这些目录的所有者或其中一个父目录。

sudo -H sets the $HOME environment variable to /root and would probably hide these but the way you did it is perfectly fine. sudo -H$HOME环境变量设置为/root并且可能会隐藏这些变量,但是你完成它的方式非常好。

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 并注意$ HOME和$ USER变量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM