Python 'pyzed' is not a package

I created image for area witn low internet connect

stereolabs/zed:4.2-devel-jetson-jp6.1.0-stereo-detector-preinstall

FROM stereolabs/zed:4.2-devel-jetson-jp6.1.0

WORKDIR /preinstall

RUN python3 /usr/local/zed/get_python_api.py

COPY ./requirements.txt .

RUN pip install --upgrade pip && \
    pip install -r requirements.txt

And create based on it

FROM stereolabs/zed:4.2-devel-jetson-jp6.1.0-stereo-detector-preinstall

WORKDIR /project

COPY ./requirements.txt .

RUN pip install --upgrade pip && \
    pip install -r requirements.txt

COPY . .

ENTRYPOINT python main.py

run bash and check

python -m pip show pyzed
Name: pyzed
Version: 1.3.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author:
Author-email:
License: UNKNOWN
Location: /usr/local/lib/python3.10/dist-packages
Requires: durationpy, python-dateutil, requests
Required-by:
root@7b9150975443:/project# pip show pyzed
Name: pyzed
Version: 1.3.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author:
Author-email:
License: UNKNOWN
Location: /usr/local/lib/python3.10/dist-packages
Requires: durationpy, python-dateutil, requests
Required-by:
root@7b9150975443:/project# python3
Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyzed
>>> import pyzed.sl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pyzed.sl'; 'pyzed' is not a package
>>> from pyzed import sl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'sl' from 'pyzed' (/usr/local/lib/python3.10/dist-packages/pyzed.py)

Hi Danila,

I am trying to figure out why you have pyzed 1.3.0 version installed, while you pulled the zed:4.2-devel-jetson-jp6.1.0 image.

By waiting, could you please run a pip list command and send us the list of the packages you are using ? I would at least know which cython and numpy version you have.

Best regards,

Hi again,
I printed the pip list using the docker image zed:4.2-devel-jetson-jp6.1.0 and I got the corresponding pyzed version (pyzed==4.2). I see that you try to get the API by running: RUN python3 /usr/local/zed/get_python_api.py in your Dockerfile, but you do not need to do it by yourself. The python API is ready to use in the image.
However, I tried to run the get_python_api.py in a container created using the zed:4.2-devel-jetson-jp6.1.0 image and it did not install the pyzed 1.3.0 so you may have another issue somewhere in your setup.

So I strongly recommend you to use the python API already installed in the docker image.
Do not hesitate to reach us again if you still have any issue with the use of our docker images.

Best regards,