John Smith
John Smith

Reputation: 6269

cannot find module beautifulsoup

I'm beginner in python and got a project, where BeautifulSoup is required. In the code its referenced like this:

 from bs4 import BeautifulSoup

Although I installed BeeatifulSoup with PyCharm, I'm getting this error:

 ImportError: No module named bs4

When I change it to:

from BeautifulSoup import BeautifulSoup

I'm getting this error, where a BeautifulSoup object is used:

links = soupObject.find_all("a")
TypeError: 'NoneType' object is not callable

And when I simply change to:

 import BeautifulSoup

Im getting this error:

soup = BeautifulSoup(param)
TypeError: 'module' object is not callable

I really don't know why this code is not working on my machine? How could I fix it? Thanks

Upvotes: 1

Views: 777

Answers (1)

Christian Witts
Christian Witts

Reputation: 11585

When you're searching for available packages in PyCharm to install into your environment, and you lookup beautifulsoup be sure to install beautifulsoup4 and not BeautifulSoup if your requirement is to use v4+.

Upvotes: 2

Related Questions