Closed ddriddle closed 6 months ago
This issue is now effecting the Github macOS runners :-(
======================================================================
ERROR: tests.test_saml (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_saml
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/Users/runner/work/awscli-login/awscli-login/src/tests/test_saml.py", line 12, in <module>
from lxml.etree import XMLSyntaxError
ImportError: dlopen(/Users/runner/work/awscli-login/awscli-login/.tox/wheel/lib/python3.8/site-packages/lxml/etree.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_exsltDateXpathCtxtRegister'
https://github.com/techservicesillinois/awscli-login/actions/runs/8849484810/job/24301956832
It is effecting version 3.8 but not 3.9, 3.10, 3.11 or 3.12 on macOS.
Another workaround that works nicely:
$ python -c 'import lxml.etree as ET'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: dlopen(/Users/ddriddle/.pyenv/versions/3.8.16/lib/python3.8/site-packages/lxml/etree.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_exsltDateXpathCtxtRegister'
$ pip uninstall lxml
$ PIP_NO_BINARY=lxml pip install lxml
$ python -c 'import lxml.etree as ET'
On my MacBook Pro with an Apple M2 Pro processor running on Sonoma 14.4.1, I have trouble loading lxml which causes awscli-login to fail. This appears to be caused by incompatible builds that are being pulled from pypi. This issues does not effect the system python (3.9.6) installed by xcode but does effect python versions installed by pyenv:
The issue is caused by importing lxml and can be simply reproduced outside awscli-login like so:
A work around is to not use the wheel but instead compile the code from source: