首页 > 解决方案 > Pip 安装错误:[Errno13] 权限被拒绝

问题描述

我正在尝试将 nltk 包安装到我的 Python2.7,但我遇到了一些麻烦。我已经检查了其他页面,但似乎对我不起作用。

当我尝试安装 nltk 时,我收到一条消息:

Could not find a version that satisfies the requirement nltk (from    versions: )
No matching distribution found for nltk

这导致我使用:

curl https://bootstrap.pypa.io/get-pip.py | python

然后它似乎工作,但后来我得到权限错误[Errno13]:

[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Consider using the `--user` option or check the permissions.

因此,我尝试将 sudo chmod 700 和 770 赋予目录文件,但不断收到相同的权限错误。我觉得我错过了什么。任何帮助,将不胜感激!

标签: pythonpython-2.7pipchmod

解决方案


您的问题是您正在尝试向系统 python 添加一个包。许多 Mac 用户使用自制软件安装 python,这样他们就不会更改系统 python 配置。这个 SO 对 OSX/Macos 上的 python 有很好的描述:

在 MacOS 上安装的用户的 python 包路径应该是什么?


推荐阅读