我使用的是 ubuntu 14.04 64 位机器。系统python是2.7.6。 这就是当我尝试 pip install 任何东西时发生的情况
thekindlyone@deepthought:~$ sudo pip install pyopenssl
The directory '/home/thekindlyone/.cache/pip/log' 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 sudo's -H flag.
The directory '/home/thekindlyone/.cache/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 sudo's -H flag.
The directory '/home/thekindlyone/.cache/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 sudo's -H flag.
Requirement already satisfied (use --upgrade to upgrade): pyopenssl in /usr/lib/python2.7/dist-packages
pip 版本为 6.1.1 我如何摆脱这些警告?
最佳答案
也许您想使用 sudo '-H' 选项将 HOME 环境变量设置为目标用户的密码数据库条目指定的主目录。
这样,pip 将使用 root 用户主目录中的缓存目录。
例如。
$ sudo -H pip install pyopenssl
关于python-2.7 - sudo pip install 的权限警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29968070/