LudovicRousseau / pyscard

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

module smartcard.util not found when running osmo-sim-auth.py #89

Closed abiodunwuyi closed 4 years ago

abiodunwuyi commented 4 years ago

Please, kindly suggest how to fix below error;

(venv) [root@ibm044 osmo-sim-auth]# ./osmo-sim-auth.py --help Traceback (most recent call last): File "./osmo-sim-auth.py", line 25, in from card.utils import * File "/root/work-dir/venv/osmo-sim-auth/card/utils.py", line 26, in from smartcard.util import toBytes ImportError: No module named smartcard.util smartcard_util error

LudovicRousseau commented 4 years ago

Maybe you need to install pyscard? Why do you ask here for an osmo-sim-auth issue?

abiodunwuyi commented 4 years ago

pyscard is already installed with "Requirements already satisfied", but the error still persists.

LudovicRousseau commented 4 years ago

What is the output of python -c 'import smartcard' and python -c 'import smartcard.util'

abiodunwuyi commented 4 years ago

import smartcard error

LudovicRousseau commented 4 years ago

it confirms that pyscard is NOT installed, or not installed correctly.

abiodunwuyi commented 4 years ago

So I have to uninstall and reinstall it?

LudovicRousseau commented 4 years ago

I can do paied consulting if you need. This is NOT an issue with pyscard.

bbaranoff commented 3 years ago

sorry to answer to a thing that is not really an issue but worked for me

sudo apt install -y python3-pip pcscd pcsc-tools libpcsclite-dev python3-pyscard python3-cmd2 libusb-1.0-0-dev
pip3 install contruct jsonpath-ng pytlv cmd2 -U
LudovicRousseau commented 3 years ago

You only need to install the python3-pyscard package. But I guess @abiodunwuyi was not using a Debian (or derivative) system.

bbaranoff commented 3 years ago

Was thinking about pySim-read.py from osmocom but that's not the place but became here first when googling error... Sorry goodbye

tomislavmiksa commented 1 month ago

Hello all

issue still there (or new one came) image

Best regards t

bbaranoff commented 1 month ago

I think this is an osmocom issue reason for what Ludovic closed this. Have you installed all PySim dependencies Screenshot_2024-06-14-13-00-20-62_40deb401b9ffe8e1df2f1cc5ba480b12

LudovicRousseau commented 1 month ago

@tomislavmiksa what is the result of:

cd
python3 -c "import smartcard.util"

I guess you are using Debian stable. Exact?