SAML-Toolkits / python3-saml

MIT License
688 stars 306 forks source link

ImportError: xmlsec.cpython-311-darwin.so #362

Closed tahayk closed 3 months ago

tahayk commented 1 year ago

Hello everyone,

Unfortunately I'm getting the following error whenever I try to run a project on MacOS13 M1, with python 3.11:

from onelogin.saml2.auth import OneLogin_Saml2_Auth
  File "/Users/tahayk/asayer/openreplay/ee/api/.venv/lib/python3.11/site-packages/onelogin/saml2/auth.py", line 12, in <module>
    import xmlsec
ImportError: dlopen(/Users/tahayk/asayer/openreplay/ee/api/.venv/lib/python3.11/site-packages/xmlsec.cpython-311-darwin.so, 0x0002): Symbol not found: _xmlSecSoap11Ns
  Referenced from: <E4FE0C82-541F-383E-98A2-ADC1187ECE31> /Users/tahayk/asayer/openreplay/ee/api/.venv/lib/python3.11/site-packages/xmlsec.cpython-311-darwin.so
  Expected in:     <DEA5BDBE-E175-3D66-A874-552778111B41> /opt/homebrew/Cellar/libxmlsec1/1.3.1/lib/libxmlsec1.1.dylib

Any idea how to fix this issue ? I'm not sure if I should publish this here or if it is related to other packages.

Thank you in advance.

lllama commented 1 year ago

+1 on this - just started a new project and have the same error.

tahayk commented 1 year ago

@lllama in the meantime, I found a temporary workaround to allow me to continue my project, I'm using the following Docker file to test my project:

FROM python:3.11-alpine3.17
RUN apk add --no-cache build-base libressl libffi-dev libressl-dev libxslt-dev libxml2-dev xmlsec-dev xmlsec

WORKDIR /work
COPY requirements.txt ./requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY . .
CMD ./entrypoint.sh
lllama commented 1 year ago

Cool - I'm assuming that ends up with a non-breaking version of xmlsec.

It looks like this is down to this issue: https://github.com/xmlsec/python-xmlsec/issues/252 xmlsec had a new release that removed some functionality and the python-xmlsec lib hasn't been updated to support it.