简体   繁体   English

在Fedora 19上安装beautifulsoup4

[英]Installing beautifulsoup4 on Fedora 19

I'm trying to install python module called, beautifulsoup4 on Fedora 19 using this command: 我正在尝试使用以下命令在Fedora 19上安装名为beautifulsoup4 python模块:

pip install beautifulsoup4

But terminal returns me an error: 但是终端返回一个错误:

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

How can I fix that? 我该如何解决?

Thanks. 谢谢。

You have not rights to install the library. 您无权安装该库。 If you are into sudoers you should type: 如果您喜欢sudoers ,则应输入:

sudo pip install beautifulsoup4

If you don't have rights to install anything, then you can use [virtualenv][1] to create your working environment and install all the stuff you need. 如果您无权安装任何东西,则可以使用[virtualenv][1]创建您的工作环境并安装所需的所有东西。

须藤dnf安装python-beautifulsoup4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM