Tag Archives: beautifulsoup

How to Solve Beautifulsoup Error: “No module named ‘bs4’.” [from bs4 import BeautifulSoup]

When we install beautiful soup 4 in PIP, we will report an error when we import beautiful soup 4: no module named’BS4′

  pip install beautifulsoup4

Then, we write this in the python script:

  from bs4 import BeautifulSoup4

The above error “no module named’BS4′” is reported during execution

After reading some methods on the Internet, I finally solved the problem in this way (on the premise that I used pychar)

Step 1:

Step 2:

Step 3: 

Step 4:

Step 5:

Step 6: If you execute the python program again, no error will be reported