LudovicRousseau / pyscard

pyscard smartcard library for python
http://pyscard.sourceforge.net/
GNU Lesser General Public License v2.1
379 stars 108 forks source link

Missing winscard.h? #78

Closed oberstet closed 5 years ago

oberstet commented 5 years ago

It seems (when building from source) the build is missing winscard.h or am I missing something?

(cpy373_1) oberstet@intel-nuci7:~$ pip3 install pyscard
Collecting pyscard
  Using cached https://files.pythonhosted.org/packages/a9/00/a7cc393234db5c9aafb8305c22c4470c794b5b43c28adf6a80ebeb3b5a2d/pyscard-1.9.8.tar.gz
Building wheels for collected packages: pyscard
  Building wheel for pyscard (setup.py) ... error
  Complete output from command /home/oberstet/cpy373_1/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-57a1ecif/pyscard/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-h6ypxj3c --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  running build_ext
  building 'smartcard.scard._scard' extension
  swigging smartcard/scard/scard.i to smartcard/scard/scard_wrap.c
  swig -python -outdir smartcard/scard -DPCSCLITE -o smartcard/scard/scard_wrap.c smartcard/scard/scard.i
  creating build
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/smartcard
  creating build/temp.linux-x86_64-3.7/smartcard/scard
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DVER_PRODUCTVERSION=1,9,8,0000 -DVER_PRODUCTVERSION_STR=1.9.8 -DPCSCLITE=1 -Ismartcard/scard/ -I/usr/include/PCSC -I/usr/local/include/PCSC -I/home/oberstet/cpy373_1/include -I/home/oberstet/cpy373/include/python3.7m -c smartcard/scard/helpers.c -o build/temp.linux-x86_64-3.7/smartcard/scard/helpers.o
  smartcard/scard/helpers.c:28:10: fatal error: winscard.h: Datei oder Verzeichnis nicht gefunden
   #include <winscard.h>
            ^~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pyscard
  Running setup.py clean for pyscard
Failed to build pyscard
Installing collected packages: pyscard
  Running setup.py install for pyscard ... error
    Complete output from command /home/oberstet/cpy373_1/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-57a1ecif/pyscard/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ee6pp2wa/install-record.txt --single-version-externally-managed --compile --install-headers /home/oberstet/cpy373_1/include/site/python3.7/pyscard:
    running install
    running build
    running build_py
    running build_ext
    building 'smartcard.scard._scard' extension
    swigging smartcard/scard/scard.i to smartcard/scard/scard_wrap.c
    swig -python -outdir smartcard/scard -DPCSCLITE -o smartcard/scard/scard_wrap.c smartcard/scard/scard.i
    creating build
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/smartcard
    creating build/temp.linux-x86_64-3.7/smartcard/scard
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DVER_PRODUCTVERSION=1,9,8,0000 -DVER_PRODUCTVERSION_STR=1.9.8 -DPCSCLITE=1 -Ismartcard/scard/ -I/usr/include/PCSC -I/usr/local/include/PCSC -I/home/oberstet/cpy373_1/include -I/home/oberstet/cpy373/include/python3.7m -c smartcard/scard/helpers.c -o build/temp.linux-x86_64-3.7/smartcard/scard/helpers.o
    smartcard/scard/helpers.c:28:10: fatal error: winscard.h: Datei oder Verzeichnis nicht gefunden
     #include <winscard.h>
              ^~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/oberstet/cpy373_1/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-57a1ecif/pyscard/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ee6pp2wa/install-record.txt --single-version-externally-managed --compile --install-headers /home/oberstet/cpy373_1/include/site/python3.7/pyscard" failed with error code 1 in /tmp/pip-install-57a1ecif/pyscard/
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(cpy373_1) oberstet@intel-nuci7:~$ 
LudovicRousseau commented 5 years ago

This header file is provided by pcsc-lite. Install libpcsclite-dev (or similar) package.

AngusP commented 1 year ago

Just adding a note for anyone that finds this, if you're on Fedora/Red Hat based systems with RPM/dnf instead, you want dnf install pcsc-lite-devel to get the equivalent of libpcsclite-dev for Debian/Ubuntu