roelderickx / connective-plugin-linux

A replacement for the Connective Plugin which is used on several websites to log in or sign documents using a card reader and an electronic identity card.
GNU General Public License v3.0
36 stars 2 forks source link

Problem installing smartcard Module #16

Open demeesterroel opened 10 months ago

demeesterroel commented 10 months ago

Installed the browser plugin.xpi in firefox Verified that native-hosts installed correctly according to this link

Test fails when running ../connective-backend.py < get_readers.txt

Traceback (most recent call last): File "/home/roeland/Downloads/connective-plugin-linux-main/test/../connective-backend.py", line 14, in <module> import smartcard ModuleNotFoundError: No module named 'smartcard'

Getting following error when running pip install pyscard

`Defaulting to user installation because normal site-packages is not writeable Collecting pyscard Using cached pyscard-2.0.7.tar.gz (152 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: pyscard Building wheel for pyscard (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [12 lines of output] Package libpcsclite was not found in the pkg-config search path. Perhaps you should add the directory containing `libpcsclite.pc' to the PKG_CONFIG_PATH environment variable Package 'libpcsclite', required by 'virtual:world', not found 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 error: command 'swig' failed: No such file or directory [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyscard Running setup.py clean for pyscard Failed to build pyscard ERROR: Could not build wheels for pyscard, which is required to install pyproject.toml-based projects`

demeesterroel commented 10 months ago

This is clearly not a bug in the connective-plugin-linux package but related to a Python and Smartcard conflict..

But if somebody knows a solution - it could be added to the documentation

demeesterroel commented 10 months ago

to solve the Smartcard building problem I tried sudo apt install libpcsclite-dev

I bumped into a Swig related problem and tried

sudo apt-get install swig3.0 ln -s /usr/bin/swig3.0 /usr/bin/swig

A that point I got an AttributeError so I gave up..

glitsj16 commented 9 months ago

I'm on Arch Linux and managed to succesfully use this awesome software instead of looking for a Window machine (which saved me a lot of hair-pulling). Instead of installing via pip, I'd try to install from the official Ubuntu repositories:

HTH

roelderickx commented 9 months ago

Many thanks @glitsj16 that should do the trick idd.

mdubit commented 1 month ago

I also had problems installing the extension on ubuntu 24.04. Eventually, it went well without using pip (which becomes harder to use since 23.10 apparently). Installing smartcard with pip adds something not compatible at all. Everything is in python3-pyscard deb package.

roelderickx commented 1 month ago

I completely agree with that, the distribution packages have priority over pip packages. The readme currently describes how to install on Ubuntu 22.04, for 24.04 it should be:

$ sudo apt-get install libpcsclite-dev python3-pyscard python3-tk
$ pip3 install nativemessaging-ng

I am not using Ubuntu myself, can you confirm the above @mdubit? It's worth adding these ready-to-copy statements since the Ubuntu-family are the most popular distributions; for the other distributions I'll add the remark about distribution-packages vs pip-packages.