I'm trying to get BeautifulSoup4 set up so that I can run the following:
from bs4 import BeautifulSoup
However, when I go to install BeautifulSoup4, I get the following:
Defaulting to user installation because normal site-packages is not writeable.
Requirement already satisfied: beautifulsoup4 in ./Library/Python/2.7/lib/python/site-packages (4.8.2)
Requirement already satisfied: soupsieve>=1.2 in ./Library/Python/2.7/lib/python/site-packages (from beautifulsoup4) (1.9.5)
Requirement already satisfied: backports.functools-lru-cache; python_version < "3" in ./Library/Python/2.7/lib/python/site-packages (from soupsieve>=1.2->beautifulsoup4) (1.6.1)
$ from bs4 import BeautifulSoup4
from: can't read /var/mail/bs4
When running in Python3 I get this error
Python 3.8.2
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from bs4 import beautifulsoup4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'beautifulsoup4' from 'bs4' (/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/bs4/__init__.py)
I have both Python 3 and Python 2.7 on my computer, but can't figure out how to get it to recognize bs4
Appreciate the advice!