1
I wanted to get back into using Python regularly, for webscraping in particular. I installed pipenv with Homebrew and began installing requests and BeautifulSoup, but when I try to import BeautifulSoup, I get the following errors:
soupsieve package is not installed. CSS selectors cannot be used.
'The soupsieve package is not installed. CSS selectors cannot be used.'
Traceback (most recent call last):
File "/Users/<user>/.local/share/virtualenvs/virtualenvs-fRlH5dZt/lib/python3.7/site-packages/test.py", line 1, in <module>
from bs4 import BeautifulSoup4
File "/Users/<user>/.local/share/virtualenvs/virtualenvs-fRlH5dZt/lib/python3.7/site-packages/bs4/__init__.py", line 34, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "/Users/<user>/.local/share/virtualenvs/virtualenvs-fRlH5dZt/lib/python3.7/site-packages/bs4/builder/__init__.py", line 7, in <module>
from bs4.element import (
File "/Users/<user>/.local/share/virtualenvs/virtualenvs-fRlH5dZt/lib/python3.7/site-packages/bs4/element.py", line 19, in <module>
from bs4.formatter import (
File "/Users/<user>/.local/share/virtualenvs/virtualenvs-fRlH5dZt/lib/python3.7/site-packages/bs4/formatter.py", line 1, in <module>
from bs4.dammit import EntitySubstitution
File "/Users/<user>/.local/share/virtualenvs/virtualenvs-fRlH5dZt/lib/python3.7/site-packages/bs4/dammit.py", line 13, in <module>
from html.entities import codepoint2name
ImportError: No module named html.entities
[Finished in 0.1s with exit code 1]
Does anyone know what the problem is? html.entities should come with Python3, so it should be available.
How are you calling your code? What does
python3 -c "import bs4; print(bs4.__version__)"
do? – slhck – 2019-09-17T07:21:13.253@slhck Running that just shows the version of BeautifulSoup 4.8.0 – LRBrady – 2019-09-17T08:04:52.983
And how are you calling your code? Please show a reproducible example (the code itself and how you are launching it). – slhck – 2019-09-17T08:40:33.943