在安装 pip 和 python 时,我遇到了一个说:
The directory '/Users/Parthenon/Library/Logs/pi' 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.
因为我现在必须使用 sudo
进行安装。
我的 Mac 上已经安装了 python 和一些库,我正在运行 Yosemite。我最近不得不做一个干净的删除,然后重新安装操作系统。现在我收到此提示,但我无法弄清楚如何更改它
之前我的命令行是 Parthenon$
现在是 Philips-MBP:~ Parthenon$
我是这台计算机的唯一所有者,并且这是它的唯一帐户。升级到 python 3.4 时这似乎是一个问题,似乎没有什么在正确的地方,virtualenv 没有按照我的预期进行,等等。
最佳答案
当我从运行 pip
到 sudo pip
时,我也在我的 Mac 上看到了这种变化。将 -H
添加到 sudo 会导致消息消失。例如
sudo -H pip install foo
man sudo
告诉我 -H
导致 sudo
将 $HOME
设置为目标用户(root在这种情况下)。
所以看起来 pip 正在查看 $HOME/Library/Log
并且默认情况下 sudo
没有将 $HOME
设置为 /root/
.毫不奇怪,~/Library/Log
归您所有,而不是 root。
我怀疑这是 pip 最近的一些变化。我暂时用 sudo -H
运行它。
关于python - pip 安装 : Please check the permissions and owner of that directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27870003/