I already have bs4 installed for anaconda and python 3, however when running some code in vscode it says that it can't find the bs4 module.
Successful Traceback in shell
Requirement already satisfied: beautifulsoup4 in /opt/anaconda3/lib/python3.7/site-packages (from bs4) (4.9.0)
Requirement already satisfied: soupsieve>1.2 in /opt/anaconda3/lib/python3.7/site-packages (from beautifulsoup4->bs4) (1.9.3)
(base) Joshuas-MacBook-Pro:~ joshuag$
Fail traceback in VSCode
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 /Users/joshuag/PycharmProjects/ThingsToKnow/WebScraping.py (base) Joshuas-MacBook-Pro:PycharmProjects joshuag$ /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 /Users/joshuag/PycharmProjects/ThingsToKnow/WebScraping.py Traceback (most recent call last): –
It smells to me like you have multiple pyhton versions:
in visual code type Ctrl+Shift+P
selecte Python select interpreter
You were getting the error because you installed it for 3.8, not 3.7
Source: VS Doc
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.