LudovicRousseau / pyscard

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

pyscard installation using pip3 fails on fedora28 #88

Closed abiodunwuyi closed 4 years ago

abiodunwuyi commented 4 years ago

I am installing pyscard on fedora28, but it keeps generating error. Please see error results below, what can I do to resolve them?

[root@ibm044 venv]# source bin/activate (venv) [root@ibm044 venv]# pip3 install pyscard WARNING: Running pip install with root privileges is generally not a good idea. Try pip3 install --user instead. Collecting pyscard Using cached https://files.pythonhosted.org/packages/ed/dd/c575bb75122c250cbed3f70440cb8e25582bf991855bb4eb27371fb8d962/pyscard-1.9.9.tar.gz Installing collected packages: pyscard Running setup.py install for pyscard ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-a3yr3q9p/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-a1udmk70-record/install-record.txt --single-version-externally-managed --compile: 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.6 creating build/temp.linux-x86_64-3.6/smartcard creating build/temp.linux-x86_64-3.6/smartcard/scard gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DVER_PRODUCTVERSION=1,9,9,0000 -DVER_PRODUCTVERSION_STR=1.9.9 -DPCSCLITE=1 -Ismartcard/scard/ -I/usr/include/PCSC -I/usr/local/include/PCSC -I/usr/include/python3.6m -c smartcard/scard/helpers.c -o build/temp.linux-x86_64-3.6/smartcard/scard/helpers.o smartcard/scard/helpers.c:28:10: fatal error: winscard.h: No such file or directory

include

          ^~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-a3yr3q9p/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-a1udmk70-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-a3yr3q9p/pyscard/ (venv) [root@ibm044 venv]# gcc failed with exit status 1

LudovicRousseau commented 4 years ago
smartcard/scard/helpers.c:28:10: fatal error: winscard.h: No such file or directory
#include <winscard.h>

install the package pcsclite-devel (or something similar).

abiodunwuyi commented 4 years ago

Thanks, it worked for me