sudo pip install django

Asi*_*sif 16 python django pip

所以这是我尝试安装Django的第一次尝试,当我运行它时,它成功安装了Django-1.7.3但我在下面收到了这些警告.我无法在网上找到任何关于它的信息所以我希望有人可以澄清他们的意思,如果我需要解决它们,以及我该如何去做呢?

谢谢!下面是我终端的输出

macbook:~ Asif$ sudo pip install Django
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)

the*_*enz 19

这些消息只是告诉您,在发出sudo当前用户之后,已经更改为root并且root不是这些目录的所有者或其中一个父目录.

sudo -H$HOME环境变量设置为/root并且可能会隐藏这些,但是你做的方式非常好.

我很确定这些消息无需担心,但总是很高兴看到人们正在阅读它们并确保它们.

另外,要验证这一点,您可以尝试:

$ sudo env | less
Run Code Online (Sandbox Code Playgroud)

$ sudo -H env | less
Run Code Online (Sandbox Code Playgroud)

并注意$ HOME和$ USER变量