I tend to do most info-beamer development on my Linux desktop, and test the builds occasionally on the raspberry pis. I didn’t realize when I upgraded Linux Mint I would lose Python 2.7, so I’m trying to get Python 3 working in info-beamer on the RPis.
From this package, it looks like all that needs to be done is to copy overlay.squashfs into the root of my package, “next to any of the package’s service files” per the docs. I did that, but my service
script fails looking for #!/usr/bin/python3
, and looking in the remote terminal, there is no python3
in /usr/bin
. It didn’t look like there were any other configuration steps in that example package.
Is there a way to tell if overlay.squashfs is overlayed on the file system? I’m running version 250603-3b291b stable (stable-0015). Thank you!
Does the overlay only occur on the service? I tried running the service manually over ssh and I get:
info-beamer-155321772 / # /service/service.root/run
Starting service
Setting up iptables rules for 1
Removing existing cgroup svc1. For a manual run, stop the automated service with: sv d /service/service.root
Overlay fs detected
Mounting /space/root/overlay.squashfs
Mounting scratch to '/space/root/SCRATCH'
ln: SCRATCH/80e0e3a21151d2b8: File exists
SCRATCH already exists. not touching
Traceback (most recent call last):
File "./service", line 8, in <module>
from py_hosted import config, node
File "/space/root/py_hosted.py", line 39, in <module>
import errno, socket, select, threading, queue, ctypes
File "/usr/lib/python3.7/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ImportError: libffi.so.6: cannot open shared object file: No such file or directory
I think that implies that the service did see Python 3, but then had an issue in libffi.
Edit: I was able to get to the next error by commenting out ctypes and everything using it.
Next issue is pyinotify.InotifyBindingNotFoundError: Couldn't find any inotify binding
, but I can comment out everything related to pyinotify.WatchManger()
to get past that and py_hosted.py issues. Am I looking for trouble trying to get Python 3 working with pyhosted?
Then, I hit “No module named pytz
”, which I guess is because python3 on the overlay.squashfs build doesn’t have the pytz package?
I’ve updated Python3 to 3.11 here. pyinotify should work, but pytz is deprecated. There is a python3-pytz-deprecation-shim
package, which should allow using import pytz_deprecation_shim as pytz
.
Thanks for the quick update to python-package
! I’ll try it out this weekend. Are there other changes that need to be made to hosted.py
from the package-sdk to work with Python 3 or is there an explicit Python 3 version? It looks like there’s a least some minor stuff like queue
vs. Queue
.