ImportError: No module named zymkey

Completed install. 3sec LED is flashing. Attempted to run test scripts and encountered error. Attempted to manually install module and it failed.

How do I install the python module zymkey?

python /usr/local/share/zymkey/examples/zk_app_utils_test.py
Traceback (most recent call last):
File “zk_app_utils_test.py”, lwine 1, in
import zymkey
ImportError: No module named zymkey

sudo pip install zymkey
Collecting zymkey
Downloading https://files.pythonhosted.org/packages/39/82/32629bfc4c2a8d048bec0eb22a3be07178d42a7a39d9b68e495fd91bef99/zymkey-0.1.3.tar.gz


python /usr/local/share/zymkey/examples/zk_app_utils_test.py
Traceback (most recent call last):
File “/usr/local/share/zymkey/examples/zk_app_utils_test.py”, line 1, in
import zymkey
File “/usr/local/lib/python2.7/dist-packages/zymkey/init.py”, line 3, in
from .module import Zymkey
File “/usr/local/lib/python2.7/dist-packages/zymkey/module.py”, line 50, in
raise ZymkeyLibraryError(‘unable to find {}, checked {}’.format(os.path.basename(ZYMKEY_LIBRARY_PATH), prefixes))
zymkey.exceptions.ZymkeyLibraryError: unable to find libzk_app_utils.so, checked [’/usr/lib/python2.7/dist-packages/usr/local/lib’, ‘/usr/local/lib’]

Please close the ticket. I have found a solution but not a cause. I am answering my own message post.

I tried the zymbit software install on another Pi and the zymkey error didn’t occur. I did another complete Pi and zymbit install and the error appeared again.

After I encountered the error, I ran the zymbit install a second time. The output from the install didn’t enlighten me because it found all the software components it was trying to install. When I ran the python scripts they worked.

I have the output from the failed install (i.e. zymkey error) and the output after the second run if this is of value.

The ironic part is the install has worked sometimes without having to run the install twice. I can’t figure out what is missing to cause this to happen.

If you get the zymkey module error just try running the zymkey install a second time and see if it provides you success.

Sean

@colporteur - which version/release of Raspian are you using ? (we think it could be version related…)

Sorry for the delay. I have been away from my lab. Raspbian Stretch Lite 2019-04-08

Sean

I had an epiphany and tried another version of python. No success:)

python3 /usr/local/share/zymkey/examples/zk_app_utils_test.py
Exception ignored in: <bound method Zymkey.del of <zymkey.module.Zymkey object at 0x769ee1d0>>
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/zymkey/module.py”, line 74, in del
raise AssertionError(‘bad return code {!r}’.format(ret))
AssertionError: bad return code -1
Testing data lock…
Traceback (most recent call last):
File “/usr/local/share/zymkey/examples/zk_app_utils_test.py”, line 6, in
dst = zymkey.client.lock(src)
AttributeError: ‘NoneType’ object has no attribute ‘lock’