Python error in first (calibration) script of new PiCar-X

The first PiCar test script I started on my new PiCar-X with the newest Raspberry Pi OS gave a python-related fatal error.

A concerning message “no robot hat 5 found“ … “config sound card without mic“ happened during the i2samp.sh script.
My kit came with robot hat v4 with speaker on top and a USB mic. Should there be taken any action on this message?

rPi OS has python v3.13.5 of june 2025, command python3 is identical.
Installation of the software gave no errors, except warnings about running pip as root and the chance on breaking system packages.

The first python script according the installation guide is the calibration tool:
$ sudo python 1.cali_servo_motor.py

the first error:
$ sudo python3 1.cali_servo_motor.py
Traceback (most recent call last):
File “/home/frans/picar-x/example/1.cali_servo_motor.py”, line 4, in
import readchar
ModuleNotFoundError: No module named ‘readchar’

was solved with:

$ sudo pip install --break-system-packages readchar

now the calibration tool runs normally, as far as I can see.

Are there any more problems to expect with the current rPi OS and python v3.13?

My system: a new, up-to-date version 5 with 8 GB memory and a 256 GB NVMe attached M.2 SSD on a Pimoroni Base card.

Glad to see you’ve solved the problem.

The error you encountered was likely because the ‘readchar’ library failed to install when you initially set up all the required libraries. This caused the error when running the example. After you separately installed ‘readchar’, the example was able to run successfully.

Unusual. Sunfounders vilib install.py should install readchar. Is camera/vilib working OK?

good call @spf650, my installation logs didn’t contain any ‘readchar’ module. Somehow I skipped the installation step for vilib.

So I installed vilib. That also takes care of my missing ‘readchar’ module.
But some important modules were skipped :
tflite-runtime, mediapipe, ai-edge-litert

tflite and ai-edge are crucial for what I want to do later on, the impact of mediapipe I don’t know at this moment

Clearly the currently published piCar software installation instructions are not corrrect anymore.

How to get these advanced features operational?

I don’t know yet.
For simplicity reasons I should should take an older and compatible version of the rPi OS and repeat the whole installation procedure. Then the OS doesn’t have Wayland as graphic environment,. but the old Xserver.
As a retired computer pro and software developer I tend to install all PiCar stuff in a VenV environment with python 3.12

My Recommendation:
in the SunFounder PiCar instructions for installing the Raspberry Pi OS, warn users about this problem and advise to use the older rPi OS image that is compatible with PiCar,
And/Or describe how to install the compatible python version and the software in a virtual environment.

My terminal log on installing vilib:

PiCar01:~/vilib $ sudo python3 install.py 
Start installing vilib 0.3.18 for user frans 
Python version: 3.13.5 
Raspbian version: 13 (64bit) 

mediapipe is only supported on 64bit system with python 3.12 or older. 
tflite-runtime is only supported on python 3.12 or older. 
Install vilib python package 
- pip3 install ./ ... Done 
- cleanup ... Done 
apt install dependency: 
- dpkg configure ... Done 
- update apt-get ... Done 
- install python3-libcamera ... Done 
- install python3-picamera2 ... Done 
- install rpicam-apps ... Done 
- install python3-pyqt5 ... Done 
- install python3-opengl ... Done 
- install python3-opencv ... Done 
- install opencv-data ... Done 
- install ffmpeg ... Done 
- install libgtk-3-0 ... Done 
- install libxcb-shm0 ... Done 
- install libcdio-paranoia-dev ... Done 
- install libsdl2-2.0-0 ... Done 
- install libxv1 ... Done 
- install libtheora0 ... Done 
- install libva-drm2 ... Done 
- install libva-x11-2 ... Done 
- install libvdpau1 ... Done 
- install libharfbuzz0b ... Done 
- install libbluray2 ... Done 
- install libzbar0 ... Done 
- install libopenblas-dev ... Done 
pip3 install dependency: 
pip3 install with --break-system-packages 
- update pip3 ... Done 
- install Flask ... Done 
- install imutils ... Done 
- install qrcode ... Done 
- install pyzbar ... Done 
- install pyzbar[scripts] ... Done 
- install readchar ... Done 
- install protobuf>=3.20.0 ... Done 
- install numpy ... Done 
 mediapipe is not supported on this platform... Skip  
 ai-edge-litert is not supported on this platform... Skip  
Create workspace 
- create dir ... Done 
- copy workspace ... Done 
Finished

Ah, you seem to be falling between the cracks of releases here. You’re on the last few crumbs of media pipe but not quite got the edge-litert libraries available for python 3.12 yet. I’m not sure there is currently a sweetspot for you. I would start with bookworm 64 as I think its the nearest sweetspot for you to develop from

But I am out date to be honest!

Thanks, I will try Bookworm,
As test I will install it on a USB3-connected SSD before overwriting my difficult-to-replace NVMe SSD.