Open farblos opened 4 weeks ago
Installing libpcsclite-dev
should fix this issue on Debian. But it’s not nice that you need to install additional libraries to get pynitrokey
to install properly. Maybe we can put the piv
command that depends on pyscard
behind an optional extra to make installation easier for those users that are not interested in PIV.
@robin-nitrokey, thanks for your quick reply and action on this. Installing libpcsclite-dev
indeeds works around the above error, but then the compile fails on Python.h
, so your fix will be most appreciated.
For reference and searching, here the error message related to Python.h
(and no, I'd rather not install more header files - will wait for your fix :-):
[~]$ pipx upgrade-all
error: subprocess-exited-with-error
× Building wheel for pyscard (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [14 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
building 'smartcard.scard._scard' extension
swigging src/smartcard/scard/scard.i to src/smartcard/scard/scard_wrap.c
swig -python -outdir src/smartcard/scard -DPCSCLITE -o src/smartcard/scard/scard_wrap.c src/smartcard/scard/scard.i
creating build/temp.linux-x86_64-cpython-312/src/smartcard/scard
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -DVER_PRODUCTVERSION=2,2,0,0000 -DVER_PRODUCTVERSION_STR=2.2.0 -DPCSCLITE=1 -Isrc/smartcard/scard/ -I/usr/include/PCSC -I/usr/local/include/PCSC -I/home/farblos/.local/share/pipx/venvs/pynitrokey/include -I/usr/include/python3.12 -c src/smartcard/scard/helpers.c -o build/temp.linux-x86_64-cpython-312/src/smartcard/scard/helpers.o
src/smartcard/scard/helpers.c:31:10: fatal error: Python.h: No such file or directory
31 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyscard
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyscard)
'/home/farblos/.local/share/pipx/venvs/pynitrokey/bin/python -m pip
--no-input install --upgrade pynitrokey -q' failed
No packages upgraded after running 'pipx upgrade-all' 😴
The following package(s) failed to upgrade: pynitrokey
For reference, python3-dev
should be the relevant package. Overall, on Debian-based systems, the packages libpcsclite-dev
, python3-dev
, gcc
and swig
should be sufficient.
I faced the same issue on Fedora 41 and fixed it by running $ sudo dnf install pcsc-lite-devel python3-devel
.
Related: https://github.com/LudovicRousseau/pyscard/issues/218.
I get the following error from
pynitrokey
duringpipx upgrade-all
Version information:
There does not seem to be a canonical candidate package providing
winscard.h
on Debian, plus I'm more or less Python-agnostic, so any help appreciated.