2013-09-26 178 views
-1

我試圖用這個命令在Fedora 19安裝一個名爲Python模塊,beautifulsoup4在Fedora上安裝beautifulsoup4 19

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 

我怎樣才能修復?

謝謝。

+1

試試'sudo pip install beautifulsoup4' – TerryA

+0

這實際上是個答案:) –

+0

哈哈,很高興聽到:) – TerryA

回答

4

您無權安裝圖書館。如果你到sudoers應鍵入:

sudo pip install beautifulsoup4 

如果您沒有權限來安裝任何東西,那麼你可以使用[virtualenv][1]創建您的工作環境,並安裝所有你需要的東西。