【问题标题】:Errno 13 Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-18954.pth'Errno 13 权限被拒绝:'/Library/Python/2.7/site-packages/test-easy-install-18954.pth'
【发布时间】:2017-09-25 21:43:13
【问题描述】:

我已经下载了 python 3.6.1,我正在尝试使用终端设置 beautifulsoup4,但它一直试图在 python 2.7 上安装。有什么帮助吗?

Jakes-iMac:beautifulsoup4-4.5.3 Jake$ cd /Users/Jake/Downloads/beautifulsoup4-4.5.3 Jakes-iMac:beautifulsoup4-4.5.3 Jake$ python setup.py install 运行安装

检查/Library/Python/2.7/site-packages/中的.pth文件支持

error: can't create or remove files in install directory

在尝试添加或删除文件时出现以下错误 安装目录:

[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-18954.pth'

您指定的安装目录(通过 --install-dir、--prefix 或 distutils 默认设置)是:

/Library/Python/2.7/site-packages/

也许您的帐户没有对该目录的写入权限?如果 安装目录是系统拥有的目录,可能需要登录 作为管理员或“root”帐户。如果你没有行政 访问本机,不妨选择不同的安装方式 目录,最好是 PYTHONPATH 环境中列出的目录 变量。

有关其他选项的信息,您不妨咨询 文档位于:

https://pythonhosted.org/setuptools/easy_install.html

请对您的系统进行适当的更改,然后重试

【问题讨论】:

  • 你能澄清一下'使用终端设置'吗?你在用点子吗?您应该检查是否使用 pip 是 3.xx python 版本的 pip 。如果您使用的是easy_install,则相同,请确保正在执行正确的python版本。

标签: python python-2.7 beautifulsoup


【解决方案1】:

试试这个:

sudo python setup.py install

【讨论】:

  • 不建议以 root 身份安装/运行开发工具。以用户身份正确安装这些工具要好得多。
【解决方案2】:

在您的终端中运行“python”命令默认情况下会在许多系统上运行 Python 2,即使您已经安装了 Python 3。尝试改用“python3”命令。

【讨论】:

  • 轰隆隆。一旦我用 python3 替换了 python,就可以完美地工作。谢谢。
  • 没问题!另外,为了将来参考,please read this
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-12-26
  • 2017-04-20
  • 2021-05-18
  • 1970-01-01
  • 1970-01-01
  • 2017-02-10
相关资源
最近更新 更多