2
$ 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...

I installed beautifulsoup4 and it seems to be successfully completed but I can't import it:

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
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
0x90
  • 39,472
  • 36
  • 165
  • 245
  • Read your documentation: http://www.crummy.com/software/BeautifulSoup/bs4/doc/ which tells you to use 'bs4' –  Dec 15 '12 at 11:58

1 Answers1

5

The module is called bs4:

from bs4 import BeautifulSoup
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343