user11749176
user11749176

Reputation:

"No module named 'bs4'" Even though bs4 is already satisfied on python 3.7?I

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): –

Upvotes: 0

Views: 143

Answers (1)

andreis11
andreis11

Reputation: 1151

It smells to me like you have multiple pyhton versions:

  1. in visual code type Ctrl+Shift+P

  2. selecte Python select interpreter

enter image description here

  1. From the list (sample image) Select Python 3.7.

You were getting the error because you installed it for 3.8, not 3.7 enter image description here

Source: VS Doc

Upvotes: 1

Related Questions