So beheben Sie ImportError: Kein Modul namens bs4Python

Python-Programme
Anonymous
 So beheben Sie ImportError: Kein Modul namens bs4

Post by Anonymous »

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

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post