Unable to import Beautifulsoup.

Asked 2 years ago, Updated 2 years ago, 79 views

After running conda install beautifulgroup4, I tried to run from bs4 import beautifulgroup, but

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Beautifulgroup' from 'bs4' (/opt/anaconda3/lib/python3.8/site-packages/bs4/_init__.py)

cannot be imported.
piplist confirms beautifulgroup4.

Please give me a solution.
Thank you for your cooperation.

python beautifulsoup

2022-09-30 19:41

1 Answers

All package names that you specify during installation are lowercase beautifulsoup4, but when you actually import them as modules, they are capitalized, such as BeautifulSoup.

 from bs4 import BeautifulSoup


2022-09-30 19:41

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.