python - 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 赋予目录文件,但不断收到相同的权限错误。我觉得我错过了什么。任何帮助,将不胜感激!
解决方案
您的问题是您正在尝试向系统 python 添加一个包。许多 Mac 用户使用自制软件安装 python,这样他们就不会更改系统 python 配置。这个 SO 对 OSX/Macos 上的 python 有很好的描述:
推荐阅读
- p5.js - 重置内容而不重新加载页面 p5
- python - 在 SQLalchemy 中调用带参数的函数
- python - 在 Windows XP 上运行 wxPython 模块?
- java - 使用最新插件将 Google App Engine 的异常从 Java 7 升级到 Java 8
- phpstorm - PhpStorm 共同部署冲突服务器根 URL
- php - substr 从帖子内容中删除图像
- javascript - 用 CSS 重新排序 div?在父 2 的子之间插入父 1
- python - 如何从 Django 中的 ForeignKey 模型中只获取一项?
- datetime - asp.net core 2.0 自定义输入时间 {mm:ss.fff}
- android - GreenRobot 对象框