Docker Python example with deepstream 6.3

I am able to get the deepstream samples work, but not the python samples

# allow root to access X Server to display output from inside the docker container
$ xhost +si:localuser:root
$ docker run -it --rm --net=host --gpus all -e DISPLAY=$DISPLAY --device /dev/snd -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/deepstream:6.3-samples
$ cd samples
$ deepstream-app -c configs/deepstream-app/source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt 

but cloning this into sources

and following the section
Running the samples inside DeepStream SDK docker

Just gives me

python3 deepstream_test_1.py 
Traceback (most recent call last):
  File "deepstream_test_1.py", line 29, in <module>
    import pyds
ModuleNotFoundError: No module named 'pyds'

and trying to install the bindings has not been succesful since not even pip is there in the first place. I got it installed, but ran into a lot of other problems trying to install the compiled bindings from

$ pip3 install pyds-1.1.8-py3-none-linux_x86_64.whl 
Failed to build pycairo
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects

What are the best way to run the python deepstream samples in docker?

It is recommended to use deepstream:6.3-triton-multiarch

docker pull nvcr.io/nvidia/deepstream:6.3-triton-multiarch

cd /opt/nvidia/deepstream/deepstream

./user_deepstream_python_apps_install.sh

Hi @junshengy

Thanks for the suggestion, I can tried it out.

But after running what you wrote I still get the same error

$ ./user_deepstream_python_apps_install.sh --version 1.1.4
Installing collected packages: pgi, pycairo, pyds
Successfully installed pgi-0.0.11.2 pycairo-1.25.1 pyds-1.1.4
$ cd /opt/nvidia/deepstream/deepstream-6.3/sources/deepstream_python_apps/apps/deepstream-test1
$ python3 deepstream_test_1.py
Traceback (most recent call last):
  File "deepstream_test_1.py", line 29, in <module>
    import pyds
ImportError: /opt/nvidia/deepstream/deepstream-6.1/lib/libnvds_meta.so: cannot open shared object file: No such file or directory

If you are running in the 6.3-triton-multiarch docker, please run

 ./user_deepstream_python_apps_install.sh --build-bindings -r master

This link contains relevant version introductions

And then I get this error

In file included from /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/bindings/../3rdparty/pybind11/include/pybind11/pytypes.h:12,
                 from /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/bindings/../3rdparty/pybind11/include/pybind11/cast.h:13,
                 from /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/bindings/../3rdparty/pybind11/include/pybind11/attr.h:13,
                 from /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/bindings/../3rdparty/pybind11/include/pybind11/pybind11.h:44,
                 from /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/bindings/include/bind/bind_string_property_definitions.h:18,
                 from /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/bindings/src/bindgstnvdsmeta.cpp:20:
/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/bindings/../3rdparty/pybind11/include/pybind11/detail/common.h:112:10: fatal error: Python.h: No such file or directory
  112 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.

Do you know why I get this error now? :)

What are the steps to get this samples running in docker?

There is no update from you for a period, assuming this is not an issue anymore.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

If you run it one day earlier, it should be ok :)

DS-6.4 has just been released, so the master corresponds to DS-6.4.

If you continue to use 6.3-triton-multiarch, the correct branch should be v1.1.8.

rm -rf  /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps

./user_deepstream_python_apps_install.sh --build-bindings -r v1.1.8

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.