2012-12-15 93 views
1
$ sudo pip install beautifulsoup4 
Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages 
Cleaning up... 

我安裝beautifulsoup4,它似乎成功完成,但我不能導入它:爲什麼在使用pip和/或easy_install安裝後,我無法使用python 2.7在mac上導入beautifulsoup?

Python 2.7.3 (v2.7.3:70, Apr 9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import beautifulsoup4 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named beautifulsoup4 
>>> import beautifulsoup 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named beautifulsoup 
+0

閱讀您的文件:HTTP:// www.crummy.com/software/BeautifulSoup/bs4/doc/告訴你使用'bs4' –

回答

5

該模塊被稱爲bs4

from bs4 import BeautifulSoup 
相關問題