-1

我正在尝试beautifulsoup4使用以下命令在 Fedora 19 上安装名为的 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

我该如何解决?

谢谢。

4

2 回答 2

4

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

sudo pip install beautifulsoup4

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

于 2013-09-26T12:44:36.657 回答
0

须藤 dnf 安装 python-beautifulsoup4

于 2018-07-09T12:31:31.813 回答