I am on Mac OS and am trying to import beautiful soup. I keep getting this error. After spending hours on trying all sorts of things to figure it out I figure I’d ask you guys.
Please help! Thanks
from bs4 import BeautifulSoup
Traceback (most recent call last):
File “/Users/kyle/Documents/Python Scripts/Count Cokes Sold 2.py”, line 8, in
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named ‘bs4’
I have tried uninstalling and reinstalling both python and beautiful soup. I have also looked at my system to see where files are stored:
import sys
print(sys.path)
[‘/Users/kyle/Documents/Python Scripts’, ‘/Users/kyle/Documents’, ‘/Library/Frameworks/Python.framework/Versions/3.12/lib/python312.zip’, ‘/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12’, ‘/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/lib-dynload’, ‘/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages’]
In the terminal window, here is where it says beautifulsoup4 is stored:
(base) kyle@Kyles-MacBook-Air ~ % pip install BeautifulSoup4
Collecting BeautifulSoup4
Using cached beautifulsoup4-4.12.3-py3-none-any.whl.metadata (3.8 kB)
Requirement already satisfied: soupsieve>1.2 in /opt/anaconda3/lib/python3.11/site-packages (from BeautifulSoup4) (2.5)
Using cached beautifulsoup4-4.12.3-py3-none-any.whl (147 kB)
Installing collected packages: BeautifulSoup4
Successfully installed BeautifulSoup4-4.12.3