Roboflow.com’s inference doesn’t yet support Python 3.13 on the Raspberry Pi 5. So I used a virtual environment with Python 3.12 using the --system-site-packages option, but Python 3.12 can’t detect the libcamera module that’s installed in Python 3.13.
I tried building the libcamera module inside the virtual environment, but there’s no version that matches the version used by rpicam.
I’ve run out of ideas
Project Type: deploy locally my workflow using roboflow inference in rpi5
Operating System & Browser: Raspberry pi 5 Bookworm; chromium
The issue is that Raspberry Pi OS Bookworm ships with Python 3.13, but Roboflow Inference requires Python 3.12 or earlier. The libcamera/picamera2 bindings are built for the system Python, so they can’t be used in a Python 3.12 virtual environment.
I would recommend utilizing a Docker container for the inference and using your system python for the camera. In the docker container, map port 9001 and optionally mount a cache volume for model weights (I saw an issue the other day in where having a cache for model weights helped greatly). Then make sure you have all your dependencies and build the script that will capture frames and send them as an HTTP post to port 9001 with your workflow and model details. From there you should be able to process the JSON response. This approach keeps your setup clean and avoids fighting with Python version conflicts or rebuilding libcamera.