Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bullseye default python version #125

Open
MS-Stamp opened this issue Feb 23, 2022 · 5 comments
Open

Bullseye default python version #125

MS-Stamp opened this issue Feb 23, 2022 · 5 comments

Comments

@MS-Stamp
Copy link

The latest Raspian build (Bullseye, Debian 11) only comes with python 3, so you have to manually install python 2 and then change the default version to get the webserver running. I used the following after a little searching on the web, but it would be good to either update the webserver for python 3 or document the workaround to support python 2.

sudo apt install python2
sudo apt install python-is-python2

@pageauc
Copy link
Owner

pageauc commented Feb 23, 2022 via email

@hughc
Copy link

hughc commented Mar 21, 2022

I haven't had any luck with this under bullseye / python3. I'm new to the script, but got it working without issues a few months back. When I returned, I started afresh with a new SD image, which I assume included the OS update.

hugh@zerotwo:~/pi-timolo $ ./pi-timolo.py
-------------------------------------------------------
pi-timolo.py ver 12.52  written by Claude Pageau
-------------------------------------------------------
Loading Wait ....
WARN  : Could Not Import pyexiv2. Required for Saving Image EXIF meta data
        If Running under python3 then Install pyexiv2 library for python3 per
        cd ~/pi-timolo
        ./install-py3exiv2.sh

Please Review Warnings  Wait 10 sec ...
Loading Wait ....
Traceback (most recent call last):
  File "/home/hugh/pi-timolo/./pi-timolo.py", line 395, in <module>
    from picamera import PiCamera
  File "/usr/lib/python3/dist-packages/picamera/__init__.py", line 72, in <module>
    from picamera.exc import (
  File "/usr/lib/python3/dist-packages/picamera/exc.py", line 41, in <module>
    import picamera.mmal as mmal
  File "/usr/lib/python3/dist-packages/picamera/mmal.py", line 49, in <module>
    _lib = ct.CDLL('libmmal.so')
  File "/usr/lib/python3.9/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libmmal.so: cannot open shared object file: No such file or directory

libmmal.so is present:

hugh@zerotwo:~/opencv3-setup $ ls /opt/vc/lib/libm*
/opt/vc/lib/libmmal_components.so  /opt/vc/lib/libmmal.so       /opt/vc/lib/libmmal_vc_client.so
/opt/vc/lib/libmmal_core.so        /opt/vc/lib/libmmal_util.so

I have enabled the legacy camera stack via rpi-config

I'm running on a Pi Zero 2 W. The github readme for python 3 suggests you need to build OpenCV, but when I download and run your build / install script, I get this:

./cv3-install-menu.sh ver 3.82    written by Claude Pageau

Internet Check OpenCV version 4.1.2  Wait ...

STATUS
Current Installed python OpenCV version is 4.5.1
Variable OPENCV_VER=4.1.2 Is a Valid OpenCV Version

UPGRADE
python OpenCV Version From 4.5.1
                       To  4.1.2

Which suggests a manual build is unnecessary?

@pageauc
Copy link
Owner

pageauc commented Mar 22, 2022 via email

@hughc
Copy link

hughc commented Mar 22, 2022

Sorry, I did not accurately explain that I had already enabled legacy camera support (I mentioned rpi-config, rather than raspi-config).

The result remains the same, still seeing the libmmal error as previously quoted. This, after reinstalling after double-checking that camera support was enabled.

@pageauc
Copy link
Owner

pageauc commented Mar 22, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants