Picar x ModuleNotFoundError: No module named 'tflite_runtime'

Hi,

In trying the controller example to enable remote control an error is coming up when running the example.

picar x ModuleNotFoundError: No module named ‘tflite_runtime’

I have looked online and it talks about virtual environments etc to install tflite.

Is there a way to install tflite to get the controller example working?

It is highly likely that during your previous installation of the library code, tflite_runtime was not successfully installed, which caused the error message when running the sample code.

We recommend that you reinstall all the library code by following the tutorial steps and then run the sample code again.

If any installation fails during the process, please provide us with the complete error message so that we can help you analyze and resolve the issue.

Thank you for your reply. I will reinstall and advise any noted errors.

Hi,

I reinstalled and here is the collection of commands and output where appropriate. The exact same error occurred.

Install All the Modules(Important) sudo apt update - SUCCESSsudo apt upgrade - SUCCESS sudo apt install git python3-pip python3-setuptools python3-smbus - SUCCESS Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0 cd ~/git clone -b v2.0 cd robot-hatsudo python3 setup.py install Robot Hat Python Library v2.3.5 install robot_hat package … DoneInstall dependencies with apt-get: update apt-get … Done install raspi-config … Done install i2c-tools … Done install espeak … Done install libsdl2-dev … Done install libsdl2-mixer-dev … Done install portaudio19-dev … Done install sox … Done install pico2wave … DoneInstall dependencies with pip3:pip3 install with --break-system-packages update pip3 … Done install smbus2 … Done install gpiozero … Done install pyaudio … Done install spidev … Done install pyserial … Done install pillow … Done install ‘pygame>=2.1.2’ … DoneSetup interfaces turn on I2C … Done turn on SPI … DoneCopy dtoverlay copy dtoverlay … Done cd ~/git clone -b picamera2 cd vilibsudo python3 install.py Start installing vilib 0.3.18 for user sg23Python version: 3.13.5Raspbian 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 … Doneapt 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 … Donepip3 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 … Donemediapipe is not supported on this platform… Skipai-edge-litert is not supported on this platform… SkipCreate workspace create dir … Done copy workspace … DoneFinished cd ~/git clone -b v2.0 --depth 1cd picar-xsudo python3 setup.py install running bdist_eggrunning egg_infocreating picarx.egg-infowriting picarx.egg-info/PKG-INFOwriting dependency_links to picarx.egg-info/dependency_links.txtwriting requirements to picarx.egg-info/requires.txtwriting top-level names to picarx.egg-info/top_level.txtwriting manifest file ‘picarx.egg-info/SOURCES.txt’reading manifest file ‘picarx.egg-info/SOURCES.txt’reading manifest template ‘MANIFEST.in’adding license file ‘LICENSE’writing manifest file ‘picarx.egg-info/SOURCES.txt’installing library code to build/bdist.linux-aarch64/eggrunning install_librunning build_pycreating build/lib/picarxcopying picarx/picarx.py → build/lib/picarxcopying picarx/version.py → build/lib/picarxcopying picarx/init.py → build/lib/picarxcreating build/bdist.linux-aarch64/eggcreating build/bdist.linux-aarch64/egg/picarxcopying build/lib/picarx/picarx.py → build/bdist.linux-aarch64/egg/picarxcopying build/lib/picarx/version.py → build/bdist.linux-aarch64/egg/picarxcopying build/lib/picarx/init.py → build/bdist.linux-aarch64/egg/picarxbyte-compiling build/bdist.linux-aarch64/egg/picarx/picarx.py to picarx.cpython-313.pycbyte-compiling build/bdist.linux-aarch64/egg/picarx/version.py to version.cpython-313.pycbyte-compiling build/bdist.linux-aarch64/egg/picarx/init.py to init.cpython-313.pyccreating build/bdist.linux-aarch64/egg/EGG-INFOcopying picarx.egg-info/PKG-INFO → build/bdist.linux-aarch64/egg/EGG-INFOcopying picarx.egg-info/SOURCES.txt → build/bdist.linux-aarch64/egg/EGG-INFOcopying picarx.egg-info/dependency_links.txt → build/bdist.linux-aarch64/egg/EGG-INFOcopying picarx.egg-info/not-zip-safe → build/bdist.linux-aarch64/egg/EGG-INFOcopying picarx.egg-info/requires.txt → build/bdist.linux-aarch64/egg/EGG-INFOcopying picarx.egg-info/top_level.txt → build/bdist.linux-aarch64/egg/EGG-INFOcreating distcreating ‘dist/picarx-2.0.5-py3.13.egg’ and adding ‘build/bdist.linux-aarch64/egg’ to itremoving ‘build/bdist.linux-aarch64/egg’ (and everything under it)Processing picarx-2.0.5-py3.13.eggcreating /usr/local/lib/python3.13/dist-packages/picarx-2.0.5-py3.13.eggExtracting picarx-2.0.5-py3.13.egg to /usr/local/lib/python3.13/dist-packagesAdding picarx 2.0.5 to easy-install.pth file Installed /usr/local/lib/python3.13/dist-packages/picarx-2.0.5-py3.13.eggProcessing dependencies for picarx==2.0.5Searching for readchar==4.2.1Best match: readchar 4.2.1Adding readchar 4.2.1 to easy-install.pth filedetected new path ‘./picarx-2.0.5-py3.13.egg’ Using /usr/local/lib/python3.13/dist-packagesFinished processing dependencies for picarx==2.0.5 cd ~/picar-xsudo bash i2samp.sh - SUCCESS sudo raspi-config cd ~git clone cd ~/sunfounder-controllersudo python3 setup.py install running bdist_eggrunning egg_infocreating sunfounder_controller.egg-infowriting sunfounder_controller.egg-info/PKG-INFOwriting dependency_links to sunfounder_controller.egg-info/dependency_links.txtwriting requirements to sunfounder_controller.egg-info/requires.txtwriting top-level names to sunfounder_controller.egg-info/top_level.txtwriting manifest file ‘sunfounder_controller.egg-info/SOURCES.txt’reading manifest file ‘sunfounder_controller.egg-info/SOURCES.txt’adding license file ‘LICENSE’writing manifest file ‘sunfounder_controller.egg-info/SOURCES.txt’installing library code to build/bdist.linux-aarch64/eggrunning install_librunning build_pycreating build/lib/sunfounder_controllercopying sunfounder_controller/version.py → build/lib/sunfounder_controllercopying sunfounder_controller/init.py → build/lib/sunfounder_controllercopying sunfounder_controller/sunfounder_controller.py → build/lib/sunfounder_controllercreating build/bdist.linux-aarch64/eggcreating build/bdist.linux-aarch64/egg/sunfounder_controllercopying build/lib/sunfounder_controller/version.py → build/bdist.linux-aarch64/egg/sunfounder_controllercopying build/lib/sunfounder_controller/init.py → build/bdist.linux-aarch64/egg/sunfounder_controllercopying build/lib/sunfounder_controller/sunfounder_controller.py → build/bdist.linux-aarch64/egg/sunfounder_controllerbyte-compiling build/bdist.linux-aarch64/egg/sunfounder_controller/version.py to version.cpython-313.pycbyte-compiling build/bdist.linux-aarch64/egg/sunfounder_controller/init.py to init.cpython-313.pycbyte-compiling build/bdist.linux-aarch64/egg/sunfounder_controller/sunfounder_controller.py to sunfounder_controller.cpython-313.pyccreating build/bdist.linux-aarch64/egg/EGG-INFOcopying sunfounder_controller.egg-info/PKG-INFO → build/bdist.linux-aarch64/egg/EGG-INFOcopying sunfounder_controller.egg-info/SOURCES.txt → build/bdist.linux-aarch64/egg/EGG-INFOcopying sunfounder_controller.egg-info/dependency_links.txt → build/bdist.linux-aarch64/egg/EGG-INFOcopying sunfounder_controller.egg-info/not-zip-safe → build/bdist.linux-aarch64/egg/EGG-INFOcopying sunfounder_controller.egg-info/requires.txt → build/bdist.linux-aarch64/egg/EGG-INFOcopying sunfounder_controller.egg-info/top_level.txt → build/bdist.linux-aarch64/egg/EGG-INFOcreating distcreating ‘dist/sunfounder_controller-0.0.2-py3.13.egg’ and adding ‘build/bdist.linux-aarch64/egg’ to itremoving ‘build/bdist.linux-aarch64/egg’ (and everything under it)Processing sunfounder_controller-0.0.2-py3.13.eggcreating /usr/local/lib/python3.13/dist-packages/sunfounder_controller-0.0.2-py3.13.eggExtracting sunfounder_controller-0.0.2-py3.13.egg to /usr/local/lib/python3.13/dist-packagesAdding sunfounder-controller 0.0.2 to easy-install.pth file Installed /usr/local/lib/python3.13/dist-packages/sunfounder_controller-0.0.2-py3.13.eggProcessing dependencies for sunfounder-controller==0.0.2Searching for websocketsReading Downloading https://files.pythonhosted.org/packages/fa/a8/5b41e0da817d64113292ab1f8247140aac61cbf6cfd085d6a0fa77f4984f/websockets-15.0.1-py3-none-any.whl#sha256=f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736fBest match: websockets 15.0.1Processing websockets-15.0.1-py3-none-any.whlInstalling websockets-15.0.1-py3-none-any.whl to /usr/local/lib/python3.13/dist-packagesAdding websockets 15.0.1 to easy-install.pth filedetected new path ‘./sunfounder_controller-0.0.2-py3.13.egg’Installing websockets script to /usr/local/bin Installed /usr/local/lib/python3.13/dist-packages/websockets-15.0.1-py3.13.eggFinished processing dependencies for sunfounder-controller==0.0.2 cd ~/picar-x/examplesudo python3 13.app_control.py vilib 0.3.18 launching …picamera2 0.3.33websocket server start at port 8765pinctrl set 20 op dhip : 10.219.226.27 Web display on: Starting web streaming … Serving Flask app ‘vilib.vilib’ Debug mode: offstop and exitTraceback (most recent call last):File “/home/sg23/picar-x/example/13.app_control.py”, line 207, inmain() File “/home/sg23/picar-x/example/13.app_control.py”, line 202, in mainVilib.object_detect_switch(False)~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^File “/usr/local/lib/python3.13/dist-packages/vilib/vilib.py”, line 766, in object_detect_switchfrom .objects_detection import object_detection_list_parameterFile “/usr/local/lib/python3.13/dist-packages/vilib/objects_detection.py”, line 14, infrom tflite_runtime.interpreter import InterpreterModuleNotFoundError: No module named ‘tflite_runtime’

</p>

The issue is reported near the top of your log file….

sg23Python version: 3.13.5Raspbian 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

You’ll need to downgrade your OS to pick up python <= v3.12

I’d suggest bookworm

Thank you. I installed bookworm 32bit and reached the point of installing vilib.

mediapipe is only supported on 64bit system with python 3.12 or older.

install libhdf5-130 … Error

Error happened in install process:
install libhdf5-130 error:
Status:100
Error:Reading package lists…
Building dependency tree…
Reading state information…
E: Unable to locate package libhdf5-130

Thank you. I have reached the point of running the controller example fine. The android phone is not reaching the picarx.

client (4, ‘10.219.226.167’) conneted
send Exception: received 1005 (no status received [internal]); then sent 1005 (no status received [internal])
4: received 1005 (no status received [internal]); then sent 1005 (no status received [internal])
client (4, ‘10.219.226.167’) disconneted

Please provide us with a video of the issue and the operating process so that we can better help you analyze and resolve the problem.

Probably irrelevant, but a 10.x.x.x ip address is usually for a larger e,g work/business type network. Home use is more usually something like 192.168.x.x, just wondering if your “work” network is blocking anything?

Total shot in the dark though!

Interesting thought. It is hotspoting through a phone so that could be something to do with it.

I will do that. I will finish changing the wifi first - just in case the hotspot phone is an issue here. If you change the wifi only is there a way to update that setting without having to reinstall the whole sd card?

Yes. You can connect your Raspberry Pi to a display, mouse, and keyboard, and then change the Wi‑Fi network connection directly on the desktop of the system.

Thank you for that.

Exitingly adding a wifi (rather than hotspotting the mobile phone) did the job. It works perfectly.

Thank you @Spf650 and @SunFounder_Moderator for your help.

oh @Spf650 ip is 192.168 etc

1 Like