LudovicRousseau / pyscard

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

No module named 'smartcard.scard._scard' #69

Closed bshbsh404 closed 5 years ago

bshbsh404 commented 5 years ago

I am running Python 3.6 on Windows 10 I have installed pyscard 1.9.7 from the executable file

It works perfectly in the example, But, when I try to use it in Odoo, it triggers an error: No module named 'smartcard.scard._scard' What is wrong ? LOG: File "C:\Program Files (x86)\Odoo 11.0e\server\odoo\addons\pos_pricing\models\__init__.py", line 26, in <module> from . import nfctool File "C:\Program Files (x86)\Odoo 11.0e\server\odoo\addons\pos_pricing\models\nfctool.py", line 1, in <module> from smartcard.System import readers File "C:\Program Files (x86)\Odoo 11.0e\server\smartcard\__init__.py", line 29, in <module> from smartcard.System import listReaders File "C:\Program Files (x86)\Odoo 11.0e\server\smartcard\System.py", line 28, in <module> import smartcard.reader.ReaderFactory File "C:\Program Files (x86)\Odoo 11.0e\server\smartcard\reader\ReaderFactory.py", line 34, in <module> from smartcard.pcsc.PCSCReader import PCSCReader File "C:\Program Files (x86)\Odoo 11.0e\server\smartcard\pcsc\PCSCReader.py", line 28, in <module> from smartcard.pcsc.PCSCContext import PCSCContext File "C:\Program Files (x86)\Odoo 11.0e\server\smartcard\pcsc\PCSCContext.py", line 27, in <module> from smartcard.scard import * File "C:\Program Files (x86)\Odoo 11.0e\server\smartcard\scard\__init__.py", line 1, in <module> from smartcard.scard.scard import * File "C:\Program Files (x86)\Odoo 11.0e\server\smartcard\scard\scard.py", line 119, in <module> _scard = swig_import_helper() File "C:\Program Files (x86)\Odoo 11.0e\server\smartcard\scard\scard.py", line 118, in swig_import_helper return importlib.import_module(mname) File "C:\Program Files (x86)\Odoo 11.0e\python\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named 'smartcard.scard._scard'

Thanks for your help

LudovicRousseau commented 5 years ago

What executable have you installed? What is Odoo?

bshbsh404 commented 5 years ago

What executable have you installed? What is Odoo?

I have installed this one "pyscard-1.9.7.win-amd64-py3.6.exe" I am able to access "smartcard.scard.scard" but not "smartcard.scard._scard"

Odoo is an ERP system made using python.

bshbsh404 commented 5 years ago

The same code is working on Ubuntu 18.04, So i guess it's a dependency issue with Windows

LudovicRousseau commented 5 years ago

If the sample codes works fine on Windows then the installer should be fine. I suspect a problem of integration in Odoo. I don't think I can help here.