lxml 5.x crashes at runtime on macOS ARM with symbol not found _exsltDateXpathCtxtRegister
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Undecided
|
scoder |
Bug Description
Attempting to import lxml.html on macOS with ARM architecture under Python 3.8 crashes:
```
@ py -3.8 -m pip-run -v lxml -- -c "import lxml.html"
Collecting lxml
Using cached lxml-5.
Using cached lxml-5.
Installing collected packages: lxml
Successfully installed lxml-5.2.1
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/var/folders/
from .. import etree
ImportError: dlopen(
```
This issue has been reported [here](https:/
Installing from source works around the issue:
```
jaraco.home main @ py -3.8 -m pip-run -v --no-cache --no-binary lxml lxml -- -c "import lxml.html" && echo done
Collecting lxml
Downloading lxml-5.2.1.tar.gz (3.7 MB)
━━
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: lxml
Building wheel for lxml (pyproject.toml) ... done
Created wheel for lxml: filename=
Stored in directory: /private/
Successfully built lxml
Installing collected packages: lxml
Successfully installed lxml-5.2.1
done
```
Unfortunately, for a project dependent on lxml, there's no good way to declare "always build from source when on macOS with ARM on Python 3.8", so there's no easy way to work around this issue for affected projects.
Any chance the wheel in PyPI can be re-compiled to avoid this issue?
I have the same issue on macOS 14.4.1 and lxml 5.2.1. /github. com/pywbem/ pywbem/ actions/ runs/8864089712 /job/2433890852 9
Log: https:/
Going back to lxml 4.9.4 (on macOS 14.4.1) circumvents the issue. /github. com/pywbem/ pywbem/ actions/ runs/8864275249 /job/2433928522 9
Log: https:/
Going back to macos 12.7.4 (with lxml 5.2.1) also circumvents the issue. /github. com/pywbem/ pywbem/ actions/ runs/8768044331 /job/2406198128 8
Log: https:/
In all cases, the following was used:
arm64
Python 3.8
libxml2 2.12.6
libxsslt 1.1.39