PieSquare
PieSquare

Reputation: 327

Unable to import beautifulsoup in python

I'm using Python.7.10 and have installed beautifulsoup using pip. The package was installed successfully. But when I'm trying to import beautifulsoup, I'm getting this error:

ImportError: No module named beautifulsoup

I checked the list of my installed modules and I found the beautifulsoup module in the installed modules list:

Beautiful soup Installed Picture

Error while importing

Installed module list

Upvotes: 3

Views: 17486

Answers (1)

Martijn Pieters
Martijn Pieters

Reputation: 1121196

You installed BeautifulSoup version 3; the module is called BeautifulSoup with capital B and S:

from BeautifulSoup import BeautifulSoup

See the Quickstart documentation.

You really want to upgrade to BeautifulSoup 4. BeautifulSoup 3 was discontinued in 2012.

To install version 4, use:

pip install beautifulsoup4

and import bs4:

from bs4 import BeautifulSoup

Do study the project documentation before continuing however.

Upvotes: 10

Related Questions