sudo pip install django

时间:2015-01-17 22:17:48

标签: python django pip

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

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

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

1 个答案:

答案 0 :(得分:19)

这些消息只是告诉您,在发出sudo后,当前用户已更改为rootroot不是这些目录的所有者或其中一个父目录。< / p>

sudo -H$HOME环境变量设置为/root,可能会隐藏这些变量,但您完成的方式非常好。

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

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

$ sudo env | less

$ sudo -H env | less

并注意$ HOME和$ USER变量