Closed sjenning closed 8 years ago
How did you install pyscard? from source code?
Gah. I was building from source (rpmbuild), but some compiler flags in the build env were messing it up. Nevermind!
I just bumped into this error on OSX 10.10 using pip install --user pyscard
.
This is related to swig/swig#250. In other words, different versions of Swig produce smartcard/scard/_scard.so
that need different versions of smartcard/scard/scard.py
that is not compatible among versions. Thus, smartcard/scard/scard.py
should be re-generated together with _scard.so
during installation, instead of being distributed as source file.
A quick comparison among the various smartcard/scard/scard.py
produced here, it looks to me as if the version distributed with pip does not match the definition in smartcard/scard/scard.i
anymore anyway.
@cluck do you have a patch to propose? I am not a setuptools expert.
The same behavior can be seen on Windows with Python 2.7.10. I tried to manually run latest swig and regenerate the files as suggested with no result.
+1 for me
Working on OSX 10.10.5 and python 2.7.10
Doing pip install pyscard
will install 1.9.0 and can't run not even the examples with error AttributeError: 'module' object has no attribute 'SCARD_SCOPE_USER'
Installing using pip install <url to master.zip>
makes a different error saying scard module does not exist
Any help? Does python 3 fix this issue? Any workarounds? I couldn't understand what other user this as workaround with swig and such.
Anything I can help, let me know.
I think the problem happens in the process of creating the source archives that are uploaded to sourceforce and pypi: they differ from the output of python setup.py sdist
on a clean checkout and in particular they contain the file smartcard/scard/scard.py
.
If this file wasn't present in the source, it would be created in the build_ext
step, in a format that is suitable to the generated wrapper.
@cluck I think you are right.
Can someone propose a patch so that python setup.py sdist
does the correct thing?
I think that starting with a clean checkout and running python setup.py sdist
as the sole command is the only option for now.
I suspect it to be a bug in the realm of Distutils/Setuptools that python setup.py sdist
picks up files excluded in in the MANIFEST.in
and not being idempotent before/after running python setup.py build
or other commands.
Seems like something up with swig, but I'm not a python guy. Any help appreciated!