Я пытаюсь настроить BeautifulSoup4, чтобы я мог запустить следующее:
from bs4 import BeautifulSoup
Однако, когда я go установил BeautifulSoup4, я получаю следующее:
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
При запуске в Python3 я получаю эту ошибку
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)
У меня есть и Python 3, и Python 2.7 на моем компьютере, но я не могу понять, как ее получить признать bs4
ценим советы!