hologram-python
hologram-python copied to clipboard
cannot import name 'TOTPAuthentication' from 'HologramAuth' (unknown location)
Describe the problem
I'm on ubuntu 20.04. I installed the packacke as described in the quickstart guide. The problem is that the HologramAuth package seems to be empty. When I try to run:
sudo hologram send "Hello World"
or when I try to update the firmware this error appears:
ImportError: cannot import name 'TOTPAuthentication' from 'HologramAuth' (unknown location)
I think the problem regards this line in the HologramCloud.py file when it tries to import such libraries that does not exists anywhere:
from HologramAuth import TOTPAuthentication, SIMOTPAuthentication
Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.86. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
I think there is a connection with this issue #20 . I had the same problem with Ubuntu 20.04 and python 3.8. For this reason I looked into the HologramAuth folder and I saw only .pyc files compiled probably with a different operating system. So I deleted them and consequently, the issue in the object appeared.
Yeah this is an issue with trying to distribute compiled byte code as a python package. As far as I can tell there is no way to compile for different python versions and then pack it all together and have it work on different versions of python. We do this as a security measure for the authentication package but the side effect of that is that it only works for python 3.7 which is the current default python 3 package on raspberry pis. If you tried to use the SDK on python 3.8 it would give you a bad magic number error like the issue you linked as well.
You do realize one can simply use uncompyle6 to decompile the bytecode.
yes we are aware of that