hologram-io / hologram-python

Hologram device-side Python SDK - Send messages to the cloud in just 3 lines of code!
https://hologram.io/
MIT License
89 stars 47 forks source link

ImportError: bad magic number in 'HologramAuth': b'B\r\r\n' #20

Closed andresvidal closed 4 years ago

andresvidal commented 4 years ago

Describe the problem

Running the install scripts recommended on the Hologram.io site on a clean Odroid N2 Linux install (arm64) produces and error when loading or running Hologram. I've tried using pipenv for a Python 3.6 and normal pip3 install with no luck.

$ python -V $> Python 3.6.9

Expected behavior

Please describe what you think the program should be doing here.

Actual behavior

(hologram) odroid@mali:~/hologram$ hologram --help Traceback (most recent call last): File "/home/odroid/.local/share/virtualenvs/hologram-2mxoctRU/bin/hologram", line 19, in from scripts.hologram_send import parse_hologram_send_args File "/home/odroid/.local/share/virtualenvs/hologram-2mxoctRU/lib/python3.6/site-packages/scripts/hologram_send.py", line 14, in from Hologram.HologramCloud import HologramCloud File "/home/odroid/.local/share/virtualenvs/hologram-2mxoctRU/lib/python3.6/site-packages/Hologram/HologramCloud.py", line 15, in from HologramAuth import TOTPAuthentication, SIMOTPAuthentication ImportError: bad magic number in 'HologramAuth': b'B\r\r\n'

Steps to reproduce the behavior

Please provide the exact command(s) to reproduce the error. If it's non-deterministic, try your best to describe your observations that might help us troubleshoot the error.

System information

Linux mali 4.9.196-63 #1 SMP PREEMPT Thu Oct 17 00:44:03 -03 2019 aarch64 aarch64 aarch64 GNU/Linux

Traceback (most recent call last): File "/home/odroid/.local/share/virtualenvs/hologram-2mxoctRU/bin/hologram", line 19, in from scripts.hologram_send import parse_hologram_send_args File "/home/odroid/.local/share/virtualenvs/hologram-2mxoctRU/lib/python3.6/site-packages/scripts/hologram_send.py", line 14, in from Hologram.HologramCloud import HologramCloud File "/home/odroid/.local/share/virtualenvs/hologram-2mxoctRU/lib/python3.6/site-packages/Hologram/HologramCloud.py", line 15, in from HologramAuth import TOTPAuthentication, SIMOTPAuthentication ImportError: bad magic number in 'HologramAuth': b'B\r\r\n'

DomAmato commented 4 years ago

The SDK version 0.9.0 requires python 3.7 or greater. It might install but you will get this bad magic number error on versions of python lower than 3.7

I will close this and reopen if there is a compelling reason to support older versions of python

andresvidal commented 4 years ago

Thanks. I’ll try it again. Can you guys update the Docs? They are calling for different python versions.

2.7 https://hologram.io/docs/reference/cloud/hologram-cli/

3.7 https://hologram.io/docs/reference/cloud/python-sdk/

erikbeall commented 2 years ago

Has this really been fixed for ARM with python bytecode??? With hologram v0.9.0 or 0.9.1 I'm having the exact same issue across two ARM platforms: 1) python3.7 on a Raspberry Pi (Buster) and 2) python3.8 on a Jetson Nano (Ubuntu 18.04, Jetpack 4.6.1):

ImportError: bad magic number in 'HologramAuth': b'a\r\r\n'

This is a big problem as we need to deploy a suite of agriculture tools across the USA in ~3 weeks and I'd showcased the Hologram R410M just a few days ago as our proposed solution.

DomAmato commented 2 years ago

We created packages for each of those python versions since it being packaged as bytecode prevented it from being compatible across versions of python: https://pypi.org/project/python-sdk-auth/#history

The versions correspond with the python minor number so 0.3.7 is 3.7, 0.3.8 is 3.8 and so on...

erikbeall commented 2 years ago

Thank you! I saw this in another post but due to the name being different from the hologram library I didn't understand this was intended to be a second install that fixes the bytecode issue on the hologram-python install. Works on Raspberry Pi, still need to do some digging on the Nano to get it working but I believe my problem is solved.