So beheben Sie ImportError: Kein Modul namens bs4

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: So beheben Sie ImportError: Kein Modul namens bs4

by Anonymous » 23 Dec 2024, 18:47

Ich versuche, Python-Code auszuführen. Ich habe Python und BeautifulSoup installiert, aber ich erhalte diese Fehlermeldung.
Irgendwelche Ideen?
Danke
main.py
from bs4 import BeautifulSoup

with open('index.html', 'r') as html_file:
content = html_file.read()
print(content)

Nach dem Ausführen von python main.py im Terminal
Requirement already satisfied: bs4 in /usr/local/lib/python3.9/site-packages (0.0.1)
Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.9/site-packages (from bs4) (4.12.2)
Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.9/site-packages (from beautifulsoup4->bs4) (2.5)

terminal error
ImportError: No module named bs4

Top