hologram-python icon indicating copy to clipboard operation
hologram-python copied to clipboard

cannot import name 'TOTPAuthentication' from 'HologramAuth' (unknown location)

Open danistrigaro opened this issue 5 years ago • 5 comments
trafficstars

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

danistrigaro avatar Jul 31 '20 07:07 danistrigaro

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.

issue-label-bot[bot] avatar Jul 31 '20 07:07 issue-label-bot[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.

danistrigaro avatar Jul 31 '20 08:07 danistrigaro

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.

DomAmato avatar Aug 01 '20 03:08 DomAmato

You do realize one can simply use uncompyle6 to decompile the bytecode.

openAccess avatar Aug 13 '20 05:08 openAccess

yes we are aware of that

DomAmato avatar Aug 13 '20 15:08 DomAmato