This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

Python import module problem

Hi,

I am able to use the smartcard module from my ubuntu enviroment. I unable to use with stackstorm.

The import for the unbuntu is simple “import smartcard”
My requirements.txt file in stackstorm is “smartcard”

This can be found here:
/usr/local/lib/python2.7/dist-packages/pyscard-1.9.7-py2.7-linux-x86_64.egg/smartcard

pip freeze shows this:
pyscard==1.9.7

The pack install fails here:

Collecting smartcard (from -r /opt/stackstorm/packs/extr/requirements.txt (line 7))
 (stderr:   Could not find a version that satisfies the requirement smartcard (from -r /opt/stackstorm/packs/extr/requirements.txt (line 7)) (from versions: )

Any suggestions?

The library name is pyscard - not smartcard.

requirements.txt in your pack directory should have the same format & name as what you show in the pip freeze output.

That fails, which I had tried. The local environment (not stackstorm) uses smartcard

No, the local environment does not use smartcard - you can see this in your output of pip freeze above

import smartcard is what you put inside your python code, but in order to install that library, your requirements.txt file must contain pyscard (possibly also with a fixed version).

Add pyscard to your pack requirements.txt file, and re-install the pack (or at least update the virtualenv). Do that, and report any error messages here

Yes, you are correct. I put pyscard back into requirements.txt I can now install the pack.
I think it may have failed previously from a git problem.

Thank you!

1 Like