Problem install Hailo Model Zoo Wheels

Hi,
I’m trying to compile my re-trained yolov8 model to an hef file. I am trying to get the model zoo and dataflow compiler running in a docker container. I am getting a problem when I try to pip install the model zoo. I am using the .whl file from the hailo developer zone (hailo_model_zoo-2.13.0-py3-none-any.whl).
I’m getting an error when it tries to install ‘lap’, indicating that it is trying to us deprecated distutils from numpy.

Here is the error

Blockquote

Building wheels for collected packages: lap, scikit-image, antlr4-python3-runtime, matplotlib, fire
Building wheel for lap (setup.py) … error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [28 lines of output]
/tmp/pip-install-8wmdj0ib/lap_d4c5ef0acb78440d9ccea13b6e347bf7/setup.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See Package Discovery and Resource Access using pkg_resources - setuptools 75.6.0.post20241212 documentation
from pkg_resources import parse_version
Partial import of lap during the build process.
/tmp/pip-install-8wmdj0ib/lap_d4c5ef0acb78440d9ccea13b6e347bf7/setup.py:223: DeprecationWarning:

    `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
    of the deprecation of `distutils` itself. It will be removed for
    Python >= 3.12. For older Python versions it will remain present.
    It is recommended to use `setuptools < 60.0` for those Python versions.
    For more details, see:
      https://numpy.org/devdocs/reference/distutils_status_migration.html

Blockquote

My Dockerfile looks like this:


# Update and install essential build tools and libraries
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    bash \
    build-essential \
    curl \
    liblapack-dev \
    libatlas-base-dev \
    gfortran \
    python3-distutils \
    && apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Upgrade pip, setuptools, and wheel
RUN python3 -m pip install --upgrade pip setuptools wheel

# Set the working directory inside the container
WORKDIR /app

# Copy the requirements file and install dependencies
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt

# Command to keep the container running by default (can be overridden at runtime)
CMD ["/bin/bash"]

Any ideas?
Is there something special I need to consider in my docker image to make this work?

You can simply install the Hailo AI Software Suite Docker. It contains all the dependencies. Just download the zip file from the Developer Zone, unpack and run the script.

So I’ve identified the problem.
TLDR; The .whl for model zoo is not compatible with python 3.11.
I downgraded to python 3.8 and it works.
@HAILO please update the developer website for downloading the whl files. It allows one to select python 3.11 for the download, even though this version does not work with 3.11.

The issue is that lap is pinned to version 0.4.0. That version uses a deprecated distutils module from numpy. This means you need to use numpy < 1.23. However, if you downgrade numpy, then you find you must use a version of setuptools < 60.0. If you try and downgrade setuptools it will fail to build because lap tries to reference longintrepr.h, which is an internal CPython header that has been removed in python 3.11.

Bottom line is, the whl won’t work with 3.11 unless the lap version is upgraded.