Repository navigation
Error installing xmlsec==1.3.13 on poetry #337
Description
I'm running a project using poetry to isolate and manage dependencies.
The python version that I'm using on poetry is 3.9.20, as projet subdependencies require that version of python
When running poetry install, I'm receiving an error while installing xmlsec on version 1.3.13:
- Installing xmlsec (1.3.13): Failed
ChefBuildError
Backend subprocess exited when trying to invoke build_wheel
WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
Traceback (most recent call last):
File "/tmp/tmp3rr37sfq/.venv/lib/python3.9/site-packages/setuptools_scm/_integration/pyproject_reading.py", line 36, in read_pyproject
section = defn.get("tool", {})[tool_name]
KeyError: 'setuptools_scm'
running bdist_wheel
running build
running build_py
creating build/lib.linux-x86_64-cpython-39/xmlsec
copying src/xmlsec/__init__.pyi -> build/lib.linux-x86_64-cpython-39/xmlsec
copying src/xmlsec/constants.pyi -> build/lib.linux-x86_64-cpython-39/xmlsec
copying src/xmlsec/template.pyi -> build/lib.linux-x86_64-cpython-39/xmlsec
copying src/xmlsec/tree.pyi -> build/lib.linux-x86_64-cpython-39/xmlsec
copying src/xmlsec/py.typed -> build/lib.linux-x86_64-cpython-39/xmlsec
running build_ext
building 'xmlsec' extension
creating build/temp.linux-x86_64-cpython-39/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DOPENSSL_NO_SSL3 -fPIC -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 -D__XMLSEC_FUNCTION__=__func__ -DXMLSEC_NO_FTP=1 -DXMLSEC_NO_HTTP=1 -DXMLSEC_NO_MD5=1 -DXMLSEC_NO_RIPEMD160=1 -DXMLSEC_NO_GOST=1 -DXMLSEC_NO_GOST2012=1 -DXMLSEC_DL_LIBLTDL=1 -DMODULE_NAME=xmlsec -DMODULE_VERSION=1.3.13 -I/usr/include/xmlsec1 -I/usr/include/libxml2 -I/tmp/tmp3rr37sfq/.venv/lib/python3.9/site-packages/lxml/includes -I/tmp/tmp3rr37sfq/.venv/lib/python3.9/site-packages/lxml -I/tmp/tmp3rr37sfq/.venv/lib/python3.9/site-packages/lxml/includes/libxml -I/tmp/tmp3rr37sfq/.venv/lib/python3.9/site-packages/lxml/includes/extlibs -I/tmp/tmp3rr37sfq/.venv/lib/python3.9/site-packages/lxml/includes/libexslt -I/tmp/tmp3rr37sfq/.venv/lib/python3.9/site-packages/lxml/includes/libxslt -I/tmp/tmp3rr37sfq/.venv/include -I/home/gbaraujosouza/.pyenv/versions/3.9.20/include/python3.9 -c /tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c -o build/temp.linux-x86_64-cpython-39/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.o -g -std=c99 -fPIC -fno-strict-aliasing -Wno-error=declaration-after-statement -Werror=implicit-function-declaration -Os
In file included from /tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:10:
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c: In function ‘PyXmlSec_ConstantsModule_Init’:
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:304:51: error: ‘xmlSecSoap11Ns’ undeclared (first use in this function); did you mean ‘xmlSecEnc11Ns’?
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/common.h:21:23: note: in definition of macro ‘DO_JOIN2’
21 | #define DO_JOIN2(X,Y) X##Y
| ^
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/common.h:19:19: note: in expansion of macro ‘DO_JOIN1’
19 | #define JOIN(X,Y) DO_JOIN1(X,Y)
| ^~~~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:304:46: note: in expansion of macro ‘JOIN’
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:319:5: note: in expansion of macro ‘PYXMLSEC_ADD_NS_CONSTANT’
319 | PYXMLSEC_ADD_NS_CONSTANT(Soap11Ns, "SOAP11");
| ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:304:51: note: each undeclared identifier is reported only once for each function it appears in
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/common.h:21:23: note: in definition of macro ‘DO_JOIN2’
21 | #define DO_JOIN2(X,Y) X##Y
| ^
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/common.h:19:19: note: in expansion of macro ‘DO_JOIN1’
19 | #define JOIN(X,Y) DO_JOIN1(X,Y)
| ^~~~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:304:46: note: in expansion of macro ‘JOIN’
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:319:5: note: in expansion of macro ‘PYXMLSEC_ADD_NS_CONSTANT’
319 | PYXMLSEC_ADD_NS_CONSTANT(Soap11Ns, "SOAP11");
| ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:304:51: error: ‘xmlSecSoap12Ns’ undeclared (first use in this function); did you mean ‘xmlSecXPath2Ns’?
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/common.h:21:23: note: in definition of macro ‘DO_JOIN2’
21 | #define DO_JOIN2(X,Y) X##Y
| ^
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/common.h:19:19: note: in expansion of macro ‘DO_JOIN1’
19 | #define JOIN(X,Y) DO_JOIN1(X,Y)
| ^~~~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:304:46: note: in expansion of macro ‘JOIN’
304 | tmp = PyUnicode_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:320:5: note: in expansion of macro ‘PYXMLSEC_ADD_NS_CONSTANT’
320 | PYXMLSEC_ADD_NS_CONSTANT(Soap12Ns, "SOAP12");
| ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:433:31: error: ‘xmlSecKeyDataEcdsaId’ undeclared (first use in this function); did you mean ‘xmlSecKeyDataDsaId’?
433 | tmp = PyXmlSec_KeyDataNew(xmlSec ## name ## Id); \
| ^~~~~~
/tmp/tmp1wtqzv7k/xmlsec-1.3.13/src/constants.c:450:5: note: in expansion of macro ‘PYXMLSEC_ADD_KEYDATA_CONSTANT’
450 | PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataEcdsa, "ECDSA")
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/chef.py:164 in _prepare
160│
161│ error = ChefBuildError("\n\n".join(message_parts))
162│
163│ if error is not None:
→ 164│ raise error from None
165│
166│ return path
167│
168│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
I'm using arch (btw ☝️🤓) and found solutions to other distros like Ubuntu in here: https://stackoverflow.com/questions/638 … ip-command
And also solution to users that uses homebrew (which is not my case) in here: https://stackoverflow.com/questions/760 … 8#76018398
It was reported a similar issue in this post but without poetry and using an old version of python(2.7)
I tried to install the dependencies mentioned and follow the sugestions on the thread, but still no solution.
Activity
ReedGraff commentedon Mar 4, 2025
CFBR
KrawczowaKris commentedon Mar 4, 2025
we use paketo buildpack and get the same error with
xmlsecthis PR says that #327 is resolved, but I don't see any wheels for the python 3.13 on the pypi
could you release them please?
augbog commentedon Mar 20, 2025
Jesus okay well I hope this works for ya'll. I just spent the last 2 hours figuring this out. For context, I'm on pyenv venv3.8.
This comment has an update in that same thread you mentioned. You still have to edit the
libxmlsec1.rbfile and andbrew install --formuladirectly on the file. Make sure you actually uninstalledlibxmlsec1even if you have to--force.Biggest change in that comment is
openssl@1.1is deprecated so it renames the references toopenssl@3. Make sure you haveopenssl@3installed. Upon runningpoetry installyou'll likely run into this error.For this I had to make sure I set the following flags
After that I was able to get it working. Idk if it matters, but I github cloned the actual repo,
git checkout 1.3.13, and thenpip installfrom the source.g4borg commentedon Apr 25, 2025
I did not do this, and I used 1.3.13 as well (although with uv not poetry), however while it compiled with replacing openssl in the rb file, during runtime it tried to access
libcrypto.1.1.dyliband failed anywaywhat did end up working for me, from this hint on stackoverflow: https://stackoverflow.com/a/79550606/1584383
so installing with --no-binary=xmlsec
and afterwards reinstalling lxml as well with no-binary
this seemed to work with latest
brew install xmlsec1