I have the same issue from a Python:3.10 Docker image, but not from my laptop (macOS).
>>> import lxml.html
>>> lxml.html.HTMLParser(encoding='latin_1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.10/site-packages/lxml/html/__init__.py", line 1910, in __init__
super(HTMLParser, self).__init__(**kwargs)
File "src/lxml/parser.pxi", line 1728, in lxml.etree.HTMLParser.__init__
File "src/lxml/parser.pxi", line 840, in lxml.etree._BaseParser.__init__
LookupError: unknown encoding: 'b'latin_1''
I have the same issue from a Python:3.10 Docker image, but not from my laptop (macOS).
>>> import lxml.html HTMLParser( encoding= 'latin_ 1') lib/python3. 10/site- packages/ lxml/html/ __init_ _.py", line 1910, in __init__ HTMLParser, self)._ _init__ (**kwargs) parser. pxi", line 1728, in lxml.etree. HTMLParser. __init_ _ parser. pxi", line 840, in lxml.etree. _BaseParser. __init_ _
>>> lxml.html.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/
super(
File "src/lxml/
File "src/lxml/
LookupError: unknown encoding: 'b'latin_1''