8

pip install xmlsec commands throws the below error.

ERROR: Command errored out with exit status 1:
   command: /home/xxx/PycharmProjects/saml_impl/saml_impl/venv/bin/python /home/sathia/PycharmProjects/saml_impl/saml_impl/venv/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpu_b5m5vz
       cwd: /tmp/pip-install-gblz98sr/xmlsec
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  package init file 'src/xmlsec/__init__.py' not found (or not a regular file)
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/xmlsec
  copying src/xmlsec/py.typed -> build/lib.linux-x86_64-3.8/xmlsec
  copying src/xmlsec/template.pyi -> build/lib.linux-x86_64-3.8/xmlsec
  copying src/xmlsec/constants.pyi -> build/lib.linux-x86_64-3.8/xmlsec
  copying src/xmlsec/__init__.pyi -> build/lib.linux-x86_64-3.8/xmlsec
  copying src/xmlsec/tree.pyi -> build/lib.linux-x86_64-3.8/xmlsec
  running build_ext
  error: Unable to invoke pkg-config.
  ----------------------------------------
  ERROR: Failed building wheel for xmlsec
Failed to build xmlsec
ERROR: Could not build wheels for xmlsec which use PEP 517 and cannot be installed directly'

I don't know how to resolve this issue. I tried to install other xmlsec package too, nothing worked.

Sathiamoorthy
  • 6,942
  • 6
  • 53
  • 64

7 Answers7

10

Xmlsec listed here https://pypi.org/project/xmlsec/. The below command should install for download required native libraries.

sudo apt-get install pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl
Sathiamoorthy
  • 6,942
  • 6
  • 53
  • 64
6

I had a similar issue with installing xmlsec. What did it for me was reinstalling the required native libraries listed here: https://pypi.org/project/xmlsec/

It was as simple as installing: brew install libxml2 libxmlsec1 pkg-config

Brian
  • 1,525
  • 8
  • 16
2

This indicates that the wheels you are trying to install aren't supported by PEP 517. Try upgrading the following packages then trying to install again

pip install --upgrade pip setuptools wheel
Amrsaeed
  • 171
  • 1
  • 9
1

i had similar issue but instead of "pkg-config" error, i had error with "xmlsec1" so i used the command

sudo apt-get install libxmlsec1-dev pkg-config

as per Could not find xmlsec1 config. Are libxmlsec1-dev and pkg-config installed?

Avin Mathew
  • 133
  • 5
  • 21
1
sudo apt-get install libxmlsec1-dev pkg-config

this will work on ubuntu / wsl ubuntu

Saurabh Chandra Patel
  • 11,619
  • 5
  • 84
  • 76
0
yum install libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel
Aniket
  • 542
  • 4
  • 13
0

Use these commands if you are getting this error in mac This will work

xcode-select --install
brew upgrade
brew install libxml2 libxmlsec1
pip install xmlsec
Aashish Kumar
  • 51
  • 1
  • 4