With the code:
from lxml.etree import HTML, XML
I get the traceback:
Traceback (most recent call last):
File "/Users/username/code/project/lxml-test.py", line 3, in <module>
from lxml.etree import HTML, XML
ImportError: dlopen(/Users/username/.virtualenvs/project-venv/lib/python3.11/site-packages/lxml/etree.cpython-311-darwin.so, 0x0002):
symbol not found in flat namespace '_xsltDocDefaultLoader'
I'm on a mac m1 chip.
I installed libxml2 and libxslt via brew.
I'm running python 3.11 inside of a virtualenv.
I posted this bug in lxml's bug report forum, and was notified that this is a highly-duplicated bug report of Missing wheel for macos with M1 Edit
I solved my problem by cloning lxml, building it, and installing it via
pip install -e /path/to/lxml