I am running a pyenv with 3.10.5 for a RPi 4 b. RPi OS version if important:
pi@raspberrypi:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)" ...
The pyenv was simply the solution I could find for running python3.10 with a bit of ease on RPi.
I have a personal script
camera_profiles.py that depends on Picamera2, and when I call it:
File "/home/pi/MYPATH/camera_profiles.py", line 8, in <module> from picamera2 import Picamera2 File "/home/pi/.pyenv/versions/3.10.5/lib/python3.10/site-packages/picamera2/__init__.py", line 1, in <module> from .picamera2 import Picamera2, Preview File "/home/pi/.pyenv/versions/3.10.5/lib/python3.10/site-packages/picamera2/picamera2.py", line 10, in <module> import libcamera ModuleNotFoundError: No module named 'libcamera'
So I need libcamera as a dependency for picamera2, however
pip install libcamera finds nothing.
The following link shows how to build libcamera, but I am unsure how this relates to usage as a module within pyenv. I'm also fairly certain my libcamera is preinstalled and works because of the following command working:
pi@raspberrypi:~ $ libcamera-hello -t 1 --nopreview [0:09:50.914967732]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3544-22656360 [0:09:50.980574004]  WARN RPI raspberrypi.cpp:1241 Mismatch between Unicam and CamHelper for embedded data usage! [0:09:50.981300155]  INFO RPI raspberrypi.cpp:1356 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media2 and ISP device /dev/media0 [0:09:50.982164044]  INFO Camera camera.cpp:1029 configuring streams: (0) 1640x1232-YUV420 [0:09:50.982681847]  INFO RPI raspberrypi.cpp:760 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected u nicam format: 1640x1232-pBAA
.. So I don't imagine installing from source will help me with this issue, but then how do I actually give picamera2 its libcamera dependency?