James Shaw
James Shaw

Reputation: 121

BeautifulSoup not working cannot import name 'BeautifulSoup' from partially initialized module 'bs4'

I keep getting error when trying to import Beautiful Soup:

from bs4 import BeautifulSoup
ImportError: cannot import name 'BeautifulSoup' from partially initialized module 
'bs4' (most likely due to a circular import)

How to resolve it?

Upvotes: 10

Views: 8909

Answers (2)

user13292922
user13292922

Reputation: 161

Try renaming python file that you working on from bs4 to something else. Maybe you named some other file in same directory bs4 so you must change it !

Upvotes: 16

Ankur Kumar
Ankur Kumar

Reputation: 104

I recently had the similar issue and was able to fix it by force reinstalling the package:

pip install --upgrade --force-reinstall beautifulsoup4

Upvotes: 0

Related Questions