pip说我使用时拒绝许可

时间:2018-06-27 19:43:29

标签: permissions pip

每当我使用pip安装时都会收到此消息

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/Markdown-2.6.11.dist-info'
Consider using the `--user` option or check the permissions.

我也收到这样的消息,说这是不可以的。

requests 2.18.4 has requirement idna<2.7,>=2.5, but you'll have idna 2.7 which is incompatible.
requests 2.18.4 has requirement urllib3<1.23,>=1.21.1, but you'll have urllib3 1.23 which is incompatible.

为什么会发生?我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

pip默认情况下会尝试将系统范围的模块安装在通常只有root具有写权限的位置。

如错误消息所示,您可以使用--user选项在用户下安装模块:

$ pip install --user requests