LudovicRousseau / pyscard

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

Latest Windows Installer not able to import module #111

Closed tomioe closed 3 years ago

tomioe commented 3 years ago

Your system information

Please describe your issue in as much detail as possible:

On a fresh Python installation I tried installing pyscard, but I ran into trouble:

c:\dev\py\smartcard>python
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

c:\dev\py\smartcard>python --version
Python 3.8.6

c:\dev\py\smartcard>pip list
Package    Version
---------- -------
pip        21.0.1
setuptools 49.2.1
wheel      0.36.2

c:\dev\py\smartcard>pip install pyscard-2.0.0-cp38-cp38-win_amd64.whl
Processing .\pyscard-2.0.0-cp38-cp38-win_amd64.whl
Installing collected packages: pyscard
Successfully installed pyscard-2.0.0

c:\dev\py\smartcard>type smartcard.py
from smartcard.scard import *

c:\dev\py\smartcard>python smartcard.py
Traceback (most recent call last):
  File "smartcard.py", line 1, in <module>
    from smartcard.scard import *
  File "c:\dev\py\smartcard\smartcard.py", line 1, in <module>
    from smartcard.scard import *
ModuleNotFoundError: No module named 'smartcard.scard'; 'smartcard' is not a package

c:\dev\py\smartcard>

I'm really not sure what I am doing wrong here, but it's probably just a code id10T.

Steps for reproducing this issue:

  1. Install latest version of Python 3.8
  2. Install wheel
  3. Download pyscard-2.0.0-cp38-cp38-win_amd64.whl from AppVeyor and install it.
  4. Make a basic program that just imports the pyscard library.
LudovicRousseau commented 3 years ago

For an unknown reason the binary module is not always loaded on Windows. It works fine when using Python from miniconda but not the "standard" Python install.

I do not use Windows so I can't really help. If you have the solution that would be appreciated.

tomioe commented 3 years ago

Didn't have any luck with installing it in miniconda either. I'll try installing it on Ubuntu instead, thanks.