LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Libcamera Version Error on Raspberry Pi 5 (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/libcamera-version-error-on-raspberry-pi-5-a-4175756335/)

thehhague 12-03-2025 05:50 AM

Libcamera Version Error on Raspberry Pi 5
 
I am trying to use the IMX500 AI camera on a Raspberry Pi 5 (trixie 13.2). The trouble is that I am using Pyenv to run my virtual environment in Python 3.11 so it is compatible with the Aitrios Raspberry Pi application module library. There are problems using Libcamera in a virtual environment even with –system-site-packages enabled when creating the environment. When I try to install rpi-libcamera in my venv I get a version error

Code:

This package works with libcamera version v0.5.0+59-d83ff0a4, but you have version v0.5.2+99-bfd68f78 installed.
According to the pypi site, I need to ensure compatibility with the versions listed in their table but I seems the libcamera version I have is new and is incompatible with the rpi-libcamera package and is not listed on their table.

How do I revert to libcamera v0.5.0+59-d83ff0a4? Although I suppose the real question is: will this solve the issue?

I don’t want to go messing around with the system’s packages without advice in case I make it worse, I am not an experienced Linux user.
Post Reply1 post • Page 1 of 1

pan64 12-04-2025 02:41 AM

see here: https://github.com/raspberrypi/pylibcamera
Quote:

apt install -y python3-libcamera

thehhague 12-05-2025 04:15 AM

Thanks for the reply. This leaves me with the same error seeing as I now have libcamera build v0.6.0+rpt20251202 which is not compatible with the latest rpi-libcamera which requires libcamera build v0.5.0+59-d8ff0a4.

pan64 12-05-2025 04:36 AM

what you wrote is confusing. v0.5.0 cannot be the latest (you installed v0.6.0).
How did you install rpi-libcamera? All of these packages should come from the same repo to keep compatibility.
Also, how do you use venv?

thehhague 12-05-2025 05:48 AM

I first used pyenv to set my terminal to a python3.11 version, then created a venv using
Code:

python -m venv --system-site-packages <my venv name>
. Within the venv I use
Code:

pip install rpi-libcamera
. The rpi-libcamera needs libcamera v0.5.0 to work (an older version), I have libcamera v0.6.0 installed so it throws the error.

pan64 12-05-2025 06:44 AM

I guess you need to forget that rpi-libcamera and use only python3-libcamera
see here: https://pypi.org/project/rpi-libcamera/ if you really want to use it.

thehhague 12-09-2025 04:07 AM

What part specifically from that link are you referring to? I have followed the instructions offered on that site and have had no luck due to version incompatibility. For reference libcamera works just fine on a venv running in the default version of Python on the raspberry pi but it seems that using pyenv to go back to 3.11 is what causes the problem. But I have to use 3.11 for the Aitrios library.

pan64 12-09-2025 04:33 AM

As they wrote, do not use rpi-libcamera unless it is unavoidable for some reason.
use only python3-libcamera, if possible.
That is one side.

The other side is, if you still need it use
Quote:

sudo apt install -y libcamera-dev
pip install rpi-libcamera
which will put the module into your [current] venv, and also will build the mentioned lib (which will [obviously] compatible with that venv). But in this case don't use --system-site-packages, because that is not compatible with this venv.

thehhague 12-09-2025 05:06 AM

So I guess the problem is with the venv because I have libcamera installed already as default. Maybe the Aitrios library has not caught up to the current state of raspberry pi and IMX500 software in December 2025, strange considering that is the library's sole purpose.

pan64 12-09-2025 05:30 AM

the python module is tied to the lib (to the given version), it is not related to anything else. That's why when you load (import) the module it will look for the compatible version of the so file.
So either you use an older module with an older lib or the current module with the current lib or build/install both the module and lib together.


All times are GMT -5. The time now is 06:47 PM.