frankmorgner / vsmartcard

umbrella project for emulation of smart card readers or smart cards
http://frankmorgner.github.io/vsmartcard/
684 stars 197 forks source link

vicc fails to run on debian sid with python3.11 #250

Closed Revilum closed 1 month ago

Revilum commented 1 year ago

Expected behaviour

I cloned the git repository and followed the installation instructions. no compile errors or warning occured

What should happen? vicc to start correctly

Actual behaviour

~/vsmartcard/virtualsmartcard$ vicc
Traceback (most recent call last):
  File "/usr/local/bin/vicc", line 116, in <module>
    from virtualsmartcard.VirtualSmartcard import VirtualICC
ModuleNotFoundError: No module named 'virtualsmartcard'

What happens instead? vicc crashes and doesn't find the virtualsmartcard python module

Steps to reproduce

  1. install vsmartcard with python3.11
  2. vicc won't run

Logs

There seems to be an inoccrent site-packages path set. python3 -m site returns: ``` sys.path = [ '/home/nils/vsmartcard/virtualsmartcard', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/home/nils/.local/lib/python3.11/site-packages', '/usr/local/lib/python3.11/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.11/dist-packages', ] USER_BASE: '/home/nils/.local' (exists) USER_SITE: '/home/nils/.local/lib/python3.11/site-packages' (exists) ENABLE_USER_SITE: True

while ./configure returns: Python site-packages: /usr/local/lib/python3.11/site-packages which is incorrect

frankmorgner commented 1 year ago

Not sure what's going wrong on your machine, we're using AM_PATH_PYTHON, which should have the proper detection methods in place. To work around this, please just set PYTHONPATH to the correct directory.

MainTobias commented 8 months ago

I've got the same problem on the latest kali-rolling(2023.3) running in wsl2. I've tried compiling from the latest release and from the git master branch. Everything seams to work until this happens. Connecting from the phone works too. Just can't use vicc. I've also tried installing python3-virtualsmartcard, however that didn't fix it.

frankmorgner commented 8 months ago

It is a feature of AM_PATH_PYTHON to automatically add your specified prefix to the install location of the site-packages. You may want to specify the installation prefix explicitly to avoid /usr/local, which is the default, e.g.:

./configure --prefix=/home/nils/.local
frankmorgner commented 1 month ago

If you don't want to install or (byte) compile the modules, you can use the scripts directly after the git checkout of the vsmartcard repository:

env PYTHONPATH=$PWD/virtualsmartcard/src/vpicc python3 virtualsmartcard/src/vpicc/vicc.in