简体   繁体   中英

Python module issue - “ModuleNotFoundError” and “Requirement already satisfied”

I am trying to run a simple python script using the beautifulsoup4 module.

However, when I run the.py file, I get a ModuleNotFoundError. When I try to pip3 install beautifulsoup4 I get Requirement already satisfied .

I've tried:

  • uninstalling and reinstalling [with and without sudo ];
  • easy_install beautifulsoup4 ;
  • checking the paths with which python3 ; and
  • all of the above in python2.7

Is there a simple fix for this?

You should use

from bs4 import BeautifulSoup

check the link: https://pypi.org/project/beautifulsoup4/

Since you used pip3 install module run your script with python3 script.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM