【发布时间】:2015-03-12 09:32:01
【问题描述】:
我刚刚开始构建新的 macbook pro。我是管理员用户。如果我运行 pip 命令,我始终会收到权限被拒绝错误,例如:
权限被拒绝:'/lib/python2.7/site-packages/'
当我跑步时
$ sudo pip install <package>
我收到此错误:
The directory '/Users/nate_argetsinger/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/nate_argetsinger/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/nate_argetsinger/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.
添加 -H 标志会抑制错误。
最后,我相信我是拥有错误消息所指目录的用户:
➜ startbootstrap-agency git:(gh-pages) ✗ ls -l
...
drwx------ 3 nate_argetsinger staff 102 Jan 14 03:29 c
drwx------ 3 nate_argetsinger staff 102 Jan 14 03:42 d
drwx------ 5 nate_argetsinger staff 170 Jan 14 03:29 f
➜ startbootstrap-agency git:(gh-pages) ✗ whoami
nate_argetsinger
➜ startbootstrap-agency git:(gh-pages) ✗
提前致谢。
【问题讨论】:
-
很高兴您解决了您遇到的问题。你有什么问题?
标签: python permissions pip sudo