Hi.
I did sudo apt update and sudo apt full-upgrade
sudo apt install hailo-all
reboot
git clone GitHub - hailo-ai/hailo-rpi5-examples
cd hailo-rpi5-examples
source setup_env.sh
pip install -r requirements.txt
./download_resources.sh
all ok till here but when i do : python basic_pipelines/detection.py --input resources/detection0.mp4
i’m getting : “detection.py”, line 12, in
import hailo
ModuleNotFoundError: No module named ‘hailo’
"
Need some help guys plz
S.
Did you run source setup_env.sh on the repository root folder to activate the python virtual environment first? Try running that then the python basic_pipelines/detection.py --input resources/detection0.mp4
ofc I did. i posted that in first message. there is a list of what i did one after another. no errors. Strangly when i open detection.py in Geany and run (i know it’s without parameters but i just want to know where it breaks) it stops at line 8 : Traceback (most recent call last):
File “/home/pi/Desktop/AI/AIKIT/hailo-rpi5-examples/basic_pipelines/detection.py”, line 8, in
import setproctitle
ModuleNotFoundError: No module named ‘setproctitle’
Import Hailo is on line 12 and code looks like this : import gi
gi.require_version(‘Gst’, ‘1.0’)
from gi.repository import Gst, GLib
import os
import argparse
import multiprocessing
import numpy as np
import setproctitle
import cv2
import time
import hailo
so i’m moving import hailo on line 1 to see if it will die at import hailo . so code before execution looks like this :
import hailo
import gi
gi.require_version(‘Gst’, ‘1.0’)
from gi.repository import Gst, GLib
import os
import argparse
import multiprocessing
import numpy as np
import setproctitle
import cv2
import time
but on execute i have : Traceback (most recent call last):
File “/home/pi/Desktop/AI/AIKIT/hailo-rpi5-examples/basic_pipelines/detection.py”, line 9, in
import setproctitle
ModuleNotFoundError: No module named ‘setproctitle’
so hailo was visible … i do not understand what is going on
Hi Please make sure your are in the correct virtualenv.
The example virtual environment should be called venv_hailo_rpi5_examples in your description it looks like you are running inside a base virtualenv (or Conda)
Please deactivate your current virtualenv and rerun the installation from the RPi default python. Hailo dependencies are installed to this python and the virtualenv inherits it using the --system-site-packages flag.
The hailo package is install to system python. Not in any venv or conda env.
You check it by import hailo on system default python. Not in any conda or venv
So when create env via venv ,you need add -system-site-packages args. Then the venv will include system package.
I don’t know how conda can use system python package.
Also your venv or conda python version need the same as system python. In raspi 5 should be 3.11. If python version different , the hailo package wouldn’t included.
(base) what I know should be conda default env , this does not include any system python package.
The problem is “sudo apt install hailo-all”, is install in your system python package.
What you need to is include the system python package to your venv or conda env. But I don’t know how can be done in conda.
If you use venv direactly , it is simple just create your env with --system-site-packages.
If you can find a method to include system-site-packages to conda (base) env, then the problem should be gone.
When you in (base) to create any new venv with --system-site-packages will include (base) as the base python package, not system python package.
I am also having the same issue. This means that, although I’ve just bought the chip, I can’t even run the hailo-rpi5-examples making it a little useless right now…
The only difference between my case and the OP is that even my system python package doesn’t have hailo installed.
(base) Blah@Blah:~ $ python
Python 3.12.3 | packaged by Anaconda, Inc. | (main, May 6 2024, 19:37:29) [GCC 11.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import hailo
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘hailo’
I have already installed using “sudo apt install hailo-all” and rebooted my device, but it still shows the same “ModuleNotFoundError: No module named ‘hailo’” error.
I have already checked the outputs of hailortcli fw-control identify, gst-inspect-1.0 hailo, and gst-inspect-1.0 hailotools. None of those show anything out of the ordinary.
Never mind, I didn’t realize that I still had Conda activated. Just needed to deactivate Conda environment and recreate the venv so that the system Python was used instead.