Issue with Importing hailort 4.20.0 Module in Python 3.10.4 Environment

Hello Community!

I am facing an issue where the hailort module is not recognized in my Python environment, despite being installed correctly. Here is a detailed breakdown of the issue and the steps I’ve taken so far:

Environment Setup:

I am using pyenv to manage Python versions, with a virtual environment hailoconv set to Python 3.10.4.
The environment is activated successfully (pyenv activate hailoconv), and I have verified this by running python --version (which shows Python 3.10.4).

hailort Installation:

I installed hailort version 4.20.0 appropriate for python 3.10 using .whil file hailort-4.20.0-cp310-cp310-linux_aarch64.whl. Suitable for my system arch.

Confirmed the installation with pip show hailort, which shows that version 4.20.0 is installed in the correct path:

/home/my/.pyenv/versions/3.10.4/envs/hailoconv/lib/python3.10/site-packages.

Issue Encountered:

Despite the successful installation of hailort, when I attempt to import the module in Python (import hailort), I receive the following error:

ModuleNotFoundError: No module named 'hailort'

I verified the Python executable being used with which python, which correctly points to

/home/my/.pyenv/versions/3.10.4/envs/hailoconv/bin/python

I have tried importing the module directly in a Python session using the following:

import hailort

But it still returns the ModuleNotFoundError.

Attempts to Resolve:

I have tried deactivating and reactivating the environment (pyenv deactivate / pyenv activate hailoconv).

Reinstalled hailort by running pip uninstall hailort followed by pip install hailort.

Checked the PYTHONPATH environment variable and ensured it includes the correct path to the site-packages directory for the virtual environment.

Could you assist me in resolving this issue? The installation seems correct, but the module is not being recognized in Python, and I have exhausted basic troubleshooting steps.

I am aiming to use the script to run .hef custom built model on raspy5 with a hailo hat.

Thank you for your support.

Hey @bublinimuzini,

Let me clarify our Python package imports. Instead of hailort, you should be using:

import hailo
import hailo_platform

from hailo_platform import (HEF, VDevice, FormatType, HailoSchedulingAlgorithm)
from hailo_platform import (HEF, Device, VDevice, HailoStreamInterface, ConfigureParams,
    InputVStreamParams, OutputVStreamParams, InputVStreams, OutputVStreams, FormatType)

Try these imports and let us know if you need any further assistance!

Best regards,
Omria

1 Like

Thank you for the reply Omria! i’ll try it out.

The issue still persists… are there any debugging steps you would recommend?

I tried to run the script outside the env. and i got

Traceback (most recent call last):
  File "/home/abela/Documents/superhailo/inference.py", line 4, in <module>
    import hailo
ImportError: libgsthailometa.so.3: cannot open shared object file: No such file or directory

Hi omria,
The script worked with just importring hailo_platfrom and skipping hailo import.