Running Python Applications in Docker

I’m creating a docker container for to run the python samples in deepstream_python_apps
As far as I can see, the docker conatiners here (DeepStream | NVIDIA NGC) do not have python support. So I’m trying to add that to the docker file.

This is my dockerfile:

FROM nvcr.io/nvidia/deepstream:5.0-dp-20.04-devel
COPY myapp /root/apps/myapp

RUN apt-get update &&
apt-get upgrade -y

RUN apt-get install -y --force-yes git build-essential autotools-dev automake autoconf
libtool python3-dev libpython3-dev libgstreamer1.0-dev

INSTALL GST PYTHON

RUN apt-get install python-gi-dev -y &&
export GST_LIBS=“-lgstreamer-1.0 -lgobject-2.0 -lglib-2.0” &&
export GST_CFLAGS=“-pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include” &&
git clone GitHub - GStreamer/gst-python: GStreamer Python binding overrides (complementing the bindings provided by python-gi). This module has been merged into the main GStreamer repo for further development. &&
cd gst-python &&
git checkout 1a8f48a &&
./autogen.sh PYTHON=python3 &&
./configure PYTHON=python3 &&
make &&
make install

RUN cd /opt/nvidia/deepstream/deepstream-5.0/sources && git clone GitHub - NVIDIA-AI-IOT/deepstream_python_apps: DeepStream SDK Python bindings and sample applications

ENV NVIDIA_DRIVER_CAPABILITIES $NVIDIA_DRIVER_CAPABILITIES,video

When I try to run the python samples I get:

python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream-5.0/samples/streams/sample_720p.h264
Traceback (most recent call last):
File “deepstream_test_1.py”, line 33, in
import pyds
ModuleNotFoundError: No module named ‘pyds’

Then when trying to setup the pyds module
cd /opt/nvidia/deepstream/deepstream/lib
python3 setup.py install
There is no setup file in the directory and no pyds.so file

What am I doing wrong?
How can I get this working?

Hi @g4ussian,
Could you use docker nvcr.io/nvidia/deepstream:5.0.1-20.09-devel or other 5.0.1 dockers under DeepStream | NVIDIA NGC ?

5.0-dp is old release, and its pyds is needed to be downlaoded from https://developer.nvidia.com/deepstream-getting-started, but it was removed now.
From 5.0-GA, pyds is integrated into DeepStream release, so if you use the latest release - 5.0.1 or its docker, there is pyds integrated.

I do find pyds integrated from 5.0-GA onwards on devel and triton branches. But I can’t find pyds in the base container. What do I do now?

Refer to Python Sample Apps and Bindings Source Details — DeepStream 6.1.1 Release documentation to install the python binding and run the python sample for DS5.x