difficulity installing Hologram SDK, Raspian bullseye or python 3.9.2 problem?

Been working for days trying to get Hologram SDK working.
When run: sudo hologram version
in a terminal I get:
sudo: hologram: command not found

When I ran: curl -L hologram.io/python-install | bash to install the SDK part of what I got was:
E: Unable to locate package libpython3.7-dev
E: Couldn’t find any package by glob ‘libpython3.7-dev’

Since the latest version of Raspian is bullseye that comes with python 3.9.2 I’m wondering if one or both of these are the problem.

Any help would be appreciated.

Here are the steps did:

Raspberry pi Model 3B+ V1.3
SARA-R410M modem
fresh install: “Raspbian GNU/Linux 11 (bullseye)”

install Hologram’s SDK
ref: Add Cellular to a Raspberry Pi with Hologram Nova - Hackster.io
sudo apt-get update
run::~ $ python -V returns: Python 3.9.2

~ $ curl -L hologram.io/python-install | bash
returns:

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 166 100 166 0 0 1784 0 --:–:-- --:–:-- --:–:-- 1804
100 166 100 166 0 0 489 0 --:–:-- --:–:-- --:–:-- 1064
100 166 100 166 0 0 261 0 --:–:-- --:–:-- --:–:-- 261
100 3880 100 3880 0 0 4340 0 --:–:-- --:–:-- --:–:-- 4340
Linux system detected
Hit:1 Index of /debian bullseye InRelease
Hit:2 Index of /raspbian bullseye InRelease
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
All packages are up to date.
python3 is already installed.
ps is already installed.
kill is already installed.
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package libpython3.7-dev
E: Couldn’t find any package by glob ‘libpython3.7-dev’

reboot
on the modem, the blue light is on, red light blinking

~ $ sudo hologram version
sudo: hologram: command not found

The issue is with an auth package our SDK uses which is only compiled for 3.7

See this PR: Remove dependency on auth package by DomAmato · Pull Request #25 · hologram-io/hologram-python · GitHub

If you want you can checkout that branch and it will work but you wont be able to generate OTPs and will instead have to send the device key to authenticate

Dom,
Thank you VERY much for your rapid response.

For anyone that stumbles onto this thread/problem, here’s the solution I did:
Loaded a legacy version of Raspian. I couldn’t discover how to use the Windows Raspberry Pi Imager to install legacy version of Raspian. So:
from: Operating system images – Raspberry Pi
downloaded a zip file for :
Raspberry Pi OS (Legacy) with desktop
Release date: January 28th 2022
System: 32-bit
Kernel version: 5.10
Debian version: 10 (buster)

Then used Etcher (google it or here’s one “how to” page: ref: https://linuxize.com/post/how-to-install-raspbian-on-raspberry-pi/) to burn Raspian (Buster) onto a SD card.
By default it comes loaded with python2 & python 3:
At a command prompt run: python –V will get:
Python 2.7.16
If run: python3 –V will get:
Python 3.7.3

Then:
Installed hologram
curl -L hologram.io/python-install | bash
no messages; no errors
It Works!
even after running:
sudo apt-get update
sudo apt-get upgrade
python3 stayed at version 3.7.3 (I was scare it might upgrade to 3.9)

I am having the same install issue…I have python 3.9 installed as the latest version, have manually installed 3.7 but can’t figure out how to get the libpython3.7-dev package installed…is there any way to make this work with 3.9? Help.

Marc, I came across the libpython3.7-dev package install problem. Didn’t find a solution. That’s why I started from scratch and loaded a legacy Raspian that had python 3.7 as default. (Don’t know if your using Raspberry pi - if not perhaps there’s a legacy version with python 3.7 of whatever you’re using).
Karl

Thanks. Yes, I’m using a Pi and I guess I will do the same thing…very frustrating that the hologram developers are requiring us to use and outdated setup to get this to work.

I posted the branch that should be compatible with python 3.9. installing it is a little less straight forward but you can just use pip like:

pip install -e git+https://github.com/hologram-io/hologram-python.git@refactor/removeauth#egg=hologram-python

The biggest thing is you will have to use device keys since the OTP will no longer work.

Thank you!

I used the pip install method to install the SDK, but when I tried to run it got an error:

sudo ~/.local/bin/hologram send --cloud --devicekey `cat device.key` -t "hello" -v "this is a test"
Traceback (most recent call last):
  File "/home/pi/.local/bin/hologram", line 4, in <module>
    __import__('pkg_resources').require('hologram-python==0.9.0')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'hologram-python==0.9.0' distribution was not found and is required by the application

Hmm I can look into it but the error does seem to be originating from the script you have in .local/bin/hologram. How did you install the script to that location? I ask because even our non-working yet latest SDK is 0.9.1 not 0.9.0: hologram-python/version.txt at develop · hologram-io/hologram-python · GitHub

Though the one in that branch is an older one and still says 0.9.0 so just want to know whats pointing where and how its determining the version numbers. You might have to force install the “older” version if you already have the newer one installed.

This is a process I used to reproduce it…

pi@rak-gateway:~ $ rm -rf .local/
pi@rak-gateway:~ $ pip install -e git+https://github.com/hologram-io/hologram-python.git@refactor/removeauth#egg=hologram-python
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Obtaining hologram-python from git+https://github.com/hologram-io/hologram-python.git@refactor/removeauth#egg=hologram-python
  Updating ./src/hologram-python clone (to revision refactor/removeauth)
  Running command git fetch -q --tags
  Running command git reset --hard -q b0634bed6d33782c11558202442853fe75b3321e
Collecting hjson~=3.0.0
  Using cached https://www.piwheels.org/simple/hjson/hjson-3.0.2-py3-none-any.whl (54 kB)
Collecting mock~=3.0.5
  Using cached https://www.piwheels.org/simple/mock/mock-3.0.5-py2.py3-none-any.whl (25 kB)
Collecting psutil~=5.6.3
  Using cached https://www.piwheels.org/simple/psutil/psutil-5.6.7-cp39-cp39-linux_armv7l.whl (264 kB)
Collecting pyroute2==0.5.*
  Using cached https://www.piwheels.org/simple/pyroute2/pyroute2-0.5.19-py3-none-any.whl (403 kB)
Collecting pyserial~=3.4.0
  Using cached https://www.piwheels.org/simple/pyserial/pyserial-3.4-py2.py3-none-any.whl (193 kB)
Collecting python-pppd==1.0.3
  Using cached https://www.piwheels.org/simple/python-pppd/python_pppd-1.0.3-py3-none-any.whl (5.5 kB)
Collecting pyudev~=0.21.0
  Using cached https://www.piwheels.org/simple/pyudev/pyudev-0.21.0-py3-none-any.whl (56 kB)
Collecting pyusb~=1.0.2
  Using cached https://www.piwheels.org/simple/pyusb/pyusb-1.0.2-py3-none-any.whl (57 kB)
Collecting requests~=2.22.0
  Using cached https://www.piwheels.org/simple/requests/requests-2.22.0-py2.py3-none-any.whl (57 kB)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from mock~=3.0.5->hologram-python) (1.16.0)
Collecting chardet<3.1.0,>=3.0.2
  Using cached https://www.piwheels.org/simple/chardet/chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting idna<2.9,>=2.5
  Using cached https://www.piwheels.org/simple/idna/idna-2.8-py2.py3-none-any.whl (58 kB)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests~=2.22.0->hologram-python) (2020.6.20)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Using cached https://www.piwheels.org/simple/urllib3/urllib3-1.25.11-py2.py3-none-any.whl (127 kB)
Installing collected packages: urllib3, idna, chardet, requests, pyusb, pyudev, python-pppd, pyserial, pyroute2, psutil, mock, hjson, hologram-python
  Running setup.py develop for hologram-python
Successfully installed chardet-3.0.4 hjson-3.0.2 hologram-python idna-2.8 mock-3.0.5 psutil-5.6.7 pyroute2-0.5.19 pyserial-3.4 python-pppd-1.0.3 pyudev-0.21.0 pyusb-1.0.2 requests-2.22.0 urllib3-1.25.11
pi@rak-gateway:~ $ sudo ~/.local/bin/hologram send --cloud --devicekey `cat device.key` -t "hello" -v "this is a test"
Traceback (most recent call last):
  File "/home/pi/.local/bin/hologram", line 4, in <module>
    __import__('pkg_resources').require('hologram-python==0.9.0')
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'hologram-python==0.9.0' distribution was not found and is required by the application

Thanks, I’ll look more into that. Its obviously been awhile since I made that branch on github to deal with this problem though I do remember it working when I pushed up the branch.

Thanks Dom.

It’s not an emergency, as I’m using RNDIS for this “release”. I do hope to use the sdk someday to be a little more efficient with data.

To just get around the headache for now I released a version for python 3.7, 3.8, and 3.9 and named it as such in the pypi release: python-sdk-auth · PyPI

Try just installing it normally and see if that works for now while I look into this a bit more. Ideally we will decouple the auth package from the SDK so that it doesn’t block people from using it since the SDK itself should work on any version > 3.7 since its not precompiled unlike the Auth library which is not publicly facing.

1 Like

Awesome, thanks!

Hi Dom,
I followed your instructions but I’m getting the following error:
File “/home/pi/.local/bin/hologram”, line 4, in
import(‘pkg_resources’).require(‘hologram-python==0.9.0’)
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 3243, in
def _initialize_master_working_set():
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 3226, in _call_aside
f(*args, **kwargs)
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 3255, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 568, in _build_master
ws.require(requires)
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 886, in require
needed = self.resolve(parse_requirements(requirements))
File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 772, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The ‘hologram-python==0.9.0’ distribution was not found and is required by the application

You can ignore that advice I gave above, I just made new releases instead that target the respective python versions. So just install normally like in our help docs if you are on python 3.9

Hi Dom,
same issue, here is the result; I’m using python 3.9.2

pi@raspberrypi:~ $ date
Wed 30 Mar 2022 12:57:11 PM EDT
pi@raspberrypi:~ $ curl -L hologram.io/python-install | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 166 100 166 0 0 2593 0 --:–:-- --:–:-- --:–:-- 2593
100 166 100 166 0 0 764 0 --:–:-- --:–:-- --:–:-- 764
100 166 100 166 0 0 373 0 --:–:-- --:–:-- --:–:-- 11066
100 3880 100 3880 0 0 6319 0 --:–:-- --:–:-- --:–:-- 6319
Linux system detected
Hit:1 Index of /debian-security bullseye-security InRelease
Hit:2 Index of /debian bullseye InRelease
Hit:3 Index of /debian bullseye-updates InRelease
Hit:4 Index of /debian bullseye InRelease
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
All packages are up to date.
python3 is already installed.
ps is already installed.
kill is already installed.
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package libpython3.7-dev
E: Couldn’t find any package by glob ‘libpython3.7-dev’
pi@raspberrypi:~ $ date
Wed 30 Mar 2022 12:59:23 PM EDT

Ah yes that line in the install script, we could def be smarter about that. I’ll change that.

Ok try it now, i changed the lib requirement in the install.sh file