【问题标题】:Installing beautifulsoup4 on Fedora 19在 Fedora 19 上安装 beautifulsoup4
【发布时间】:2013-09-26 12:38:28
【问题描述】:

我正在尝试使用以下命令在 Fedora 19 上安装名为 beautifulsoup4 的 python 模块:

pip install beautifulsoup4

但终端返回错误:

Downloading/unpacking beautifulsoup4
  Running setup.py egg_info for package beautifulsoup4

Installing collected packages: beautifulsoup4
  Running setup.py install for beautifulsoup4
    error: could not create '/usr/lib/python2.7/site-packages/bs4': Permission denied
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-misha/beautifulsoup4/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-kevEjw-record/install-record.txt --single-version-externally-managed:
    running install

running build

running build_py

running install_lib

creating /usr/lib/python2.7/site-packages/bs4

error: could not create '/usr/lib/python2.7/site-packages/bs4': Permission denied

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-misha/beautifulsoup4/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-kevEjw-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-misha/beautifulsoup4
Storing complete log in /home/misha/.pip/pip.log

我该如何解决这个问题?

谢谢。

【问题讨论】:

  • 试试sudo pip install beautifulsoup4
  • 这实际上是一个答案:)
  • 哈哈,很高兴听到:)

标签: python python-2.7 beautifulsoup fedora


【解决方案1】:

您无权安装该库。如果你进入sudoers,你应该输入:

sudo pip install beautifulsoup4

如果您无权安装任何东西,那么您可以使用[virtualenv][1] 创建您的工作环境并安装您需要的所有东西。

【讨论】:

    【解决方案2】:

    sudo dnf 安装 python-beautifulsoup4

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-20
      • 2016-01-30
      • 2018-08-05
      • 2018-04-23
      • 1970-01-01
      相关资源
      最近更新 更多