sudo pip安装djang

2024-05-19 00:21:19 发布

您现在位置:Python中文网/ 问答频道 /正文

所以这是我第一次尝试安装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

Tags: piporandthedjangoislibrarysudo
1条回答
网友
1楼 · 发布于 2024-05-19 00:21:19

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

sudo -H$HOME环境变量设置为/root,并且可能会隐藏这些变量,但您这样做是完全正确的。

我很确定这些信息没什么好担心的,但总是很高兴看到人们在阅读它们,并确保。

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

$ sudo env | less

以及

$ sudo -H env | less

注意$HOME和$USER变量

相关问题 更多 >

    热门问题