-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linux / python 2.7.3 smartcard/scard/__init__.py : from smartcard.scard.scard import * ImportError: No module named scard #15
Comments
Do you have the same problem if you install PySCard from the source code using |
Unfortunately yes
I can also note that trying earlier versions e.g. 1.6.* results in the second error above (name 'SCARD_PCI_T0' is not defined) (I suspect this is somehow a swig issue) |
Hmm, The above was from running python setup.py install while my virtualenv was activated. Just building while using the global python instead has allowed me to "import smartcard" without any errors (I'm still having a few issues but they look unrelated to this ticket). |
My other issues have been resolved (library is working great so far!). For my purposes doing a manual python setup.py install is OK (should note that I haven't had any issues with the library when installing via pip on windows). Thanks! |
Yes. It may be a swig issue. |
I can confirm that this is a swig issue. |
Mac OS X 10.11 After
or
or
I get error when trying to use the library
|
@rmrfff, try to run |
I add same issue before I read the readme file :-) build_ext option is missing !
|
Has this issue been fixed or a solution been found? I am currently trying to install pyscard, I have tried using pip and also from source and every time I get the following when trying to import the smartcard module:
Any suggestions on how to get past this issue? |
@oceanexplorer, try to combine my last two posts. It works for me. |
The only 2 solutions I founded are either : 'sudo python setup.py build_ext install' or 'apt-get install pyscard' (eventually, pip uninstall first) |
@oceanexplorer what version of pyscard do you use? From the source distribution:
|
I installed a fresh Ubuntu 14.04.2 distribution.
Note that is my case the module searched for is I DO have a file |
Then I removed the pyscard module installed by pip and installed it by hand from source. I can now It looks like a problem with the code generated by SWIG when the package is installed by pip. Do not use pip to install pyscard |
Can this thread be summarised into a single set of instructions? Should we be installing using apt-get install python-pyscard, using pip, using the git repository? A single set of instructions would be appreciated. |
Procedure that worked for me:
|
Anyone got this to work on OS-X ? Same setup as rmrfff: Tried following: git clone https://github.com/LudovicRousseau/pyscard.git Still same errors. Anyone please? |
@kababoom I develop PySCard on Mac OS X. So, yes, I can install it on Mac OS X. In a bug report you should:
|
@LudovicRousseau, apologies, all commands execute fine and error is exactly the same as the others hence I did not copy them but here they are.
second time:
cleanup
download
install
Error
lib
Did I miss anything? Thank you .... |
@kababoom in your error backtrace you have a file On my side I have:
Note the 2 extra files: |
@LudovicRousseau thanks, that pyscard site-package folder is completely removed when running pip uninstall so apparently those files are not placed there when installing from git source or I forgot something. However I did find a fix by running easy_install over source installation. Files are now there and import is working ...
Import
ls -l
Thanks for you help and for your good work !!... |
This was because 'python setup.py install' alone doesn't work, you should use 'python setup.py build_ext install' instead in previous comment before 'easy_install pyscard' also working or apt-get install ... |
@pythonous, I have tried build_ext without success, see my first post. Still not sure why source install does not put those two files. |
I compared 2 installations using
These 2 Does someone have an idea why there are not installed by pip? |
I released PySCard 1.9.2 but the problem is still present :-( |
Make sure you switch out of the source directory after installing. I found that if I run python from within the downloaded pyscard source directory (as I naturally did after installing just to test it!) I got an error about not finding module _scard (note the underscore). |
I tried 1.9.2 with both Might be related: http:https://stackoverflow.com/questions/10559589/adding-output-file-to-python-extension |
Fix #15 - installing from `pip` and `easy_install`
Using 1.9.3 It is surprising for me why |
What is wrong with |
Yeah, if I install from the network instead of the local checkout, it seems to do a bdist_wheel first to build into my pip cache, then install that. The hacky build re-ordering I was doing just doesn't come into play for bdist_wheel. :-( If I clear my pip cache, I get the same failure from a local tarball as I do from PyPi. It's more of a setuptools / SWIG not playing together thing than a pip thing. The core problem seems to be that I'll have another go at it, hopefully finding a way to ensure the build works and doesn't require a separate hack for each install method. @LudovicRousseau Just to make sure I'm on the same page: what exactly are you using to build and upload? Just BTW, thanks for maintaining this package! |
To upload to pypi I use
|
Just so you know, I get a similar error on Windows 7 64-bit, with Python 3.4.3, and swig 3.0.8:
I haven't tried any other way of installing pyscard. |
Fix #15 - installing from `pip` and `easy_install` (Take 2)
2.0.1 is again :( |
@kokoye2007 for me it works fine with Python from miniconda on Windows. I do not plan to invest more time in strange Windows behaviors. |
@LudovicRousseau I am try on Ubuntu 18.04 with many way. build install and pip3 install not working smarcard. |
@kokoye2007 for Ubuntu you an use the already existing package https://packages.ubuntu.com/search?keywords=python3-pyscard |
@LudovicRousseau yes, I already try with that. not working with both. |
@kokoye2007 the initial bug report was about python 2.7. If you still have the problem please open a new issue with full details and logs. |
I am testing on docker 'ubuntu-18.04' maybe build and apt install is conflict at last time. |
It's work on ubuntu-18-04 clean install
|
Hello,
I'm having some trouble with pyscard 1.9.1 installed via pip on an Intel Edison
running any example results in:
If I modify smartcard/scard/init.py, changing it to
I get the following:
The text was updated successfully, but these errors were encountered: