-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import xmlsec fails on python 3.8/3.9, macOS Big Sur 11.0.1 and M1 chip #163
Comments
Hi @hitesh-raichandani, it looks like you have a Mac with the new M1 chip. Unfortunately, I don't have access to this hardware yet and Github Actions doesn't offer anything either, see actions/runner-images#2187. I'm thus unable to play with building universal dists right now. Once my company sets up the infrastructure, I will come back to this, or maybe someone else will shed some light on it. |
Thanks for the update @hoefling, added package versions to the issue details for clarity. |
@hitesh-raichandani I still can't reproduce the issue due to missing hardware, but maybe you could attach the build log in the meantime? Simply |
@hoefling, the attached file has build logs. Thanks! |
I'm running into the same issue except I am running python3.7 in the Rosetta2 compatibility mode |
Same issue here with python 3.8 and M1. |
Same issue found here. Any fix yet? |
I can't investigate any issues with M1 since I don't own the necessary hardware. A colleague of mine could successfully compile Beware though, that import pathlib
pathlib.Path("doc.xml").write_text("<spam>eggs</spam>")
import xmlsec
from lxml import etree
etree.parse("doc.xml")
etree.parse("doc.xml") |
I too have found this very same issue, any fix for this ? |
I get the same issue with |
Hi there, are there any plans on progressing on this issue anytime soon? I understand the constraints, and would just like to get some feedback so that we can plan for alternatives if needed. |
Howdy! Any updates on the progression for this issue? I understand the scenario and would like to hear back regarding workarounds. Thanks |
Still having this issue on python 3.9 and M1. Any updates? |
There's nothing to report. The company I worked at didn't manage to provide the M1 hardware and I changed the job recently, so no ETA at all. Feel free to give a 👍 on actions/runner-images#2187, as accessing the M1 hardware via CI jobs will be most likely the only way for me. |
It installed on my M1 machine. Anyone trying this issue also make sure to only try with Python versions 3.8.10 and greater since that's when official support was added. ❯ pip install xmlsec==1.3.12 --no-cache-dir
Collecting xmlsec==1.3.12
Downloading xmlsec-1.3.12.tar.gz (64 kB)
|████████████████████████████████| 64 kB 3.0 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing wheel metadata ... done
Requirement already satisfied: lxml>=3.8 in ./.venv/lib/python3.8/site-packages (from xmlsec==1.3.12) (4.6.3)
Building wheels for collected packages: xmlsec
Building wheel for xmlsec (PEP 517) ... done
Created wheel for xmlsec: filename=xmlsec-1.3.12-cp38-cp38-macosx_11_0_arm64.whl size=48084 sha256=74d628b8edf4a81bde35e4a0863e2c1d2e83a7f897c0c555c1612e6b25fb1ad4
Stored in directory: /private/var/folders/j1/d109sd4n55qbk5ty8gzq5jgm0000gn/T/pip-ephem-wheel-cache-rt5nmgzu/wheels/2c/99/a3/98bcb24586c778eb35e23e30af30fbf1c34a0a9ed85e18576a
Successfully built xmlsec
Installing collected packages: xmlsec
Successfully installed xmlsec-1.3.12
❯ pkg-config --cflags xmlsec1
-D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_SIZE_T -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1 -DXMLSEC_CRYPTO_OPENSSL=1 -I/opt/homebrew/Cellar/libxmlsec1/1.2.32/include/xmlsec1 -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/openssl@1.1/include/openssl
❯ python -c "import xmlsec"
❯ file $(which python)
/Users/armenzg/code/sentry/.venv/bin/python: Mach-O 64-bit executable arm64
❯ otool -L .venv/lib/python3.8/site-packages/xmlsec.cpython-38-darwin.so
.venv/lib/python3.8/site-packages/xmlsec.cpython-38-darwin.so:
/opt/homebrew/opt/libxmlsec1/lib/libxmlsec1-openssl.1.dylib (compatibility version 4.0.0, current version 4.32.0)
/opt/homebrew/opt/libxmlsec1/lib/libxmlsec1.1.dylib (compatibility version 4.0.0, current version 4.32.0)
/opt/homebrew/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
/usr/lib/libxslt.1.dylib (compatibility version 3.0.0, current version 3.26.0)
/usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
/usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 66.1.0)
❯ brew info libxmlsec1
libxmlsec1: stable 1.2.32 (bottled)
XML security library
https://www.aleksey.com/xmlsec/
/opt/homebrew/Cellar/libxmlsec1/1.2.32 (220 files, 6.2MB) *
Poured from bottle on 2021-05-17 at 08:58:46
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libxmlsec1.rb
License: MIT
==> Dependencies
Build: pkg-config ✔
Required: gnutls ✔, libgcrypt ✘, libxml2 ✔, openssl@1.1 ✔
==> Requirements
Build: Xcode ✘
❯ brew info pkg-config
pkg-config: stable 0.29.2 (bottled)
Manage compile and link flags for libraries
https://freedesktop.org/wiki/Software/pkg-config/
/opt/homebrew/Cellar/pkg-config/0.29.2_3 (11 files, 677.1KB) *
Poured from bottle on 2021-05-17 at 08:53:19
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/pkg-config.rb
License: GPL-2.0-or-later |
Using xmlsec==1.3.12 with python 3.8.12 installed via rosetta-enabled homebrew (python@3.8) worked for me. Thanks @armenzg. |
@AddisonDunn you're welcome! How do you use rosetta with Python? I'm curious. |
When using the Python 3.8.10 "universal" version for Mac downloaded from Python.org I had no luck, but using @python3.8 (version 3.8.12) installed via the rosetta-enabled homebrew I did.
|
I got my system working by following @armenzg's suggestion. I had to install python 3.9 via rosetta homebrew, upgrade to xmlsec 1.3.12, install libxmlsec1 and pkg-config. Thanks so much! |
Hi. Unfortunately solution provided by @armenzg does not work for me on Mac OS X Monerey (12.1)
|
In my further investigation I've discovered that when building manually it does not link with homebrew-provided libxmlsec1 libraries:
|
@vpol I'm also facing the same issue (building for macOS-x86_64 but attempting to link with file built for macOS-arm64 xmlsec). Were you able to proceed further? |
Same issue here. Tried all options you had suggested, nothing worked. |
Any solution? |
@subavicky I'm working on a patch, but unfortunately can't provide ETA |
Solved it. The cause of this error was installing the psycopg2-binary, which was meant to solve a similar error of "Symbol not found: _PQbackendPID".
After doing this, psycopg2 no longer caused any problems, and the xmlsec error went away, everything works perfectly. |
I encountered this and fixed it by installing I suspect the bug is due to mixing architectures. My Python is x86_64, my xmlsec1 and further dependencies are x86_64, but I'm running on an M1 mac. Once I've installed If I find the cause, I'll put up a PR. |
@cadedaniel did you install |
where did you see these |
You can see it if you do
After that, we ran We were actually having the opposite problem as #163 (comment) - we were trying to install xmlsec for x86_64 and it was looking for arm64 packages during the installation. If you're trying to install it for arm64, find out where the arm64 version of Also, we were still getting the ld warning for openssl after adding the LDFLAGS and CPPFLAGS to .zshrc - adding the relevant flags for libxmlsec1-openssl would probably fix that, but we stopped messing with things once it started working so I'm not sure |
I just installed on Mac OS without a problem my steps are: brew install libxmlsec1 Btw Im running Ventura but should work on Monterrey also |
I had the same problem but the solutions above unfortunately didn't work in my case. Without any hope I tried to manually install I found the full solution here: #254 (comment) Not sure if it was required, but I removed Versions: |
I'm having the same issue. Doing:
Fails with:
I've installed libxml2 libxmlsec1 pkg-config via brew. Tried multiple versions of Python (3.9.7 and 3.10.4, both installed by pyenv). OSX Monterey 12.6.5. M1 Macbook pro. Homebrew versIon:
|
It installs fine but fails when importing.
Python 3.8 and 3.9
Will really appreciate any help.
The text was updated successfully, but these errors were encountered: