Search code examples
pythonpython-2.7beautifulsoupfedora

Installing beautifulsoup4 on Fedora 19


I'm trying to install python module called, beautifulsoup4 on Fedora 19 using this command:

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.


Solution

  • You have not rights to install the library. If you are into sudoers you should type:

    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.