Closed kristinux closed 3 years ago
The Python wrapper is in 2 parts: a Python part and a native code part.
The error you see is because the Python part cannot load the native part. It should be a file called _scard.cp38-win_amd64.pyd
(or something like that) on Windows.
Depending on the Python environment you use you can have or not this problem. On Windows I am using miniconda and it works for me. I also tried "standard" python but I had the problem you report. But not always.
If you find the problem and can propose a solution that would be perfect. I am not a Windows user.
Thank you for the response. I come from Linux background, all Windows issues are extremely foreign. So far I am using MSYS2/MINGW64 combination with python installed from mingw repositories. I have successfully built pyscard once in the same environment but with Python 3.8.7. I was forced to upgrade to 3.8.8 and that is where the issues started.
@LudovicRousseau I am not quite sure what has happened on my system. But perhaps after a few rebuilds I got the library working! I noticed that after a day of work and a reboot of my system.
At the moment my issue could be closed as "cannot reproduce", at least for now. I could also commit the minimalistic change I added to setup.py to get it built under msys2/mingw64.
Please share your setup.py
changes with a Pull Request.
I will have a look.
Installing pyscard using pip under msys2/mingw64 produces an enormous trace, hence I resolved to building and installing from sources.
To build I added one more condition to setup.py that would trigger similar parameters as for cygwin (if get_platform() contains 'mingw' check).
Once built and installed, I ran python interpreter and executed simple import: from smartcard import System This statement resulted in: Python 3.8.8 (default, Feb 20 2021, 07:16:03) [GCC 10.2.0 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
Any suggestions to resolve this are greatly appreciated.