[DeepStream 6.0] Unable to install python_gst into nvcr.io/nvidia/deepstream:6.0-triton container

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 6.0
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only) 470.63.01
• Issue Type( questions, new requirements, bugs) questions
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Hello,

I am trying to install python_gst and facing challenges to resolve conflict between python3.8 which is part of container image nvcr.io/nvidia/deepstream:6.0-triton and python3.6 which is set by docker_python_setup.sh

Can anyone please help how can I fix this?

ot@fe9e26dca43b:/opt/nvidia/deepstream/deepstream# ./docker_python_setup.sh
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
bubblewrap fuse libfuse2 xdg-desktop-portal
Use ‘apt autoremove’ to remove them.
The following additional packages will be installed:
python3-distro-info python3-software-properties unattended-upgrades
Suggested packages:
bsd-mailx default-mta | mail-transport-agent needrestart powermgmt-base
The following NEW packages will be installed:
python3-distro-info python3-software-properties software-properties-common unattended-upgrades
0 upgraded, 4 newly installed, 0 to remove and 96 not upgraded.
Need to get 90.3 kB of archives.
After this operation, 836 kB of additional disk space will be used.
Get:1 Index of /ubuntu focal/main amd64 python3-distro-info all 0.23ubuntu1 [5924 B]
Get:2 Index of /ubuntu focal-updates/main amd64 python3-software-properties all 0.98.9.5 [25.1 kB]
Get:3 Index of /ubuntu focal-updates/main amd64 software-properties-common all 0.98.9.5 [10.6 kB]
Get:4 Index of /ubuntu focal-updates/main amd64 unattended-upgrades all 2.3ubuntu0.1 [48.7 kB]
Fetched 90.3 kB in 1s (112 kB/s)
Preconfiguring packages …
Selecting previously unselected package python3-distro-info.
(Reading database … 69864 files and directories currently installed.)
Preparing to unpack …/python3-distro-info_0.23ubuntu1_all.deb …
Unpacking python3-distro-info (0.23ubuntu1) …
Selecting previously unselected package python3-software-properties.
Preparing to unpack …/python3-software-properties_0.98.9.5_all.deb …
Unpacking python3-software-properties (0.98.9.5) …
Selecting previously unselected package software-properties-common.
Preparing to unpack …/software-properties-common_0.98.9.5_all.deb …
Unpacking software-properties-common (0.98.9.5) …
Selecting previously unselected package unattended-upgrades.
Preparing to unpack …/unattended-upgrades_2.3ubuntu0.1_all.deb …
Unpacking unattended-upgrades (2.3ubuntu0.1) …
Setting up python3-software-properties (0.98.9.5) …
Setting up python3-distro-info (0.23ubuntu1) …
Setting up software-properties-common (0.98.9.5) …
Setting up unattended-upgrades (2.3ubuntu0.1) …

Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version

Creating config file /etc/apt/apt.conf.d/50unattended-upgrades with new version
Created symlink /etc/systemd/system/multi-user.target.wants/unattended-upgrades.service → /lib/systemd/system/unattended-upgrades.service.
Processing triggers for systemd (245.4-4ubuntu3.11) …
Processing triggers for dbus (1.12.16-2ubuntu2.1) …
Traceback (most recent call last):
File “/usr/bin/add-apt-repository”, line 12, in
from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 28, in
import apt_pkg
ModuleNotFoundError: No module named ‘apt_pkg’
Ign:1 Index of /compute/cuda/repos/ubuntu2004/x86_64 InRelease
Hit:2 Index of /ubuntu focal InRelease
Hit:3 Index of /deadsnakes/ppa/ubuntu focal InRelease
Hit:4 Index of /ubuntu focal-updates InRelease
Hit:5 Index of /ubuntu focal-security InRelease
Hit:6 Index of /ubuntu focal-backports InRelease
Ign:7 Index of /compute/machine-learning/repos/ubuntu1804/x86_64 InRelease
Hit:8 Index of /compute/cuda/repos/ubuntu2004/x86_64 Release
Hit:9 Index of /compute/machine-learning/repos/ubuntu1804/x86_64 Release
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
python3.6 is already the newest version (3.6.15-1+focal1).
The following packages were automatically installed and are no longer required:
bubblewrap fuse libfuse2 xdg-desktop-portal
Use ‘apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 96 not upgraded.
Reading package lists… Done
Building dependency tree
Reading state information… Done
libpython3.6 is already the newest version (3.6.15-1+focal1).
The following packages were automatically installed and are no longer required:
bubblewrap fuse libfuse2 xdg-desktop-portal
Use ‘apt autoremove’ to remove them.
0 upgraded, 0 newly installed, 0 to remove and 96 not upgraded.
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
bubblewrap distro-info-data fuse gir1.2-packagekitglib-1.0 libappstream4 libfuse2 liblmdb0 libpackagekit-glib2-18 libpolkit-agent-1-0 libpolkit-gobject-1-0 libstemmer0d
libyaml-0-2 lsb-release packagekit policykit-1 python-apt-common python3-apt python3-certifi python3-chardet python3-dbus python3-distro-info python3-idna python3-requests
python3-requests-unixsocket python3-six python3-urllib3 unattended-upgrades xdg-desktop-portal
Use ‘apt autoremove’ to remove them.
The following packages will be REMOVED:
python-gi-dev python3-gi python3-software-properties software-properties-common
0 upgraded, 0 newly installed, 4 to remove and 96 not upgraded.
After this operation, 1120 kB disk space will be freed.
(Reading database … 69940 files and directories currently installed.)
Removing python-gi-dev (3.36.0-1) …
Removing software-properties-common (0.98.9.5) …
Removing python3-software-properties (0.98.9.5) …
Removing python3-gi (3.36.0-1) …
Processing triggers for dbus (1.12.16-2ubuntu2.1) …
–2021-11-01 12:33:39-- http://mirrors.edge.kernel.org/ubuntu/pool/main/p/pygobject/python3-gi_3.26.1-2ubuntu1_amd64.deb
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)… 147.75.95.133, 2604:1380:3000:1500::1
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.95.133|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 153080 (149K) [application/octet-stream]
Saving to: ‘python3-gi_3.26.1-2ubuntu1_amd64.deb.1’

python3-gi_3.26.1-2ubuntu1_amd64.deb.1 100%[============================================================================================>] 149.49K 724KB/s in 0.2s

2021-11-01 12:33:39 (724 KB/s) - ‘python3-gi_3.26.1-2ubuntu1_amd64.deb.1’ saved [153080/153080]

Selecting previously unselected package python3-gi.
(Reading database … 69859 files and directories currently installed.)
Preparing to unpack python3-gi_3.26.1-2ubuntu1_amd64.deb …
Unpacking python3-gi (3.26.1-2ubuntu1) …
dpkg: dependency problems prevent configuration of python3-gi:
python3-gi depends on python3 (<< 3.7); however:
Version of python3 on system is 3.8.2-0ubuntu2.
python3-gi depends on libffi6 (>= 3.0.4); however:
Package libffi6 is not installed.
libgirepository-1.0-1:amd64 (1.64.1-1~ubuntu20.04.1) breaks python3-gi (<< 3.34.0-4~) and is installed.
Version of python3-gi to be configured is 3.26.1-2ubuntu1.

dpkg: error processing package python3-gi (–install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python3-gi
ln: failed to create symbolic link ‘/lib/x86_64-linux-gnu/libffi.so.6’: File exists
There are 3 choices for the alternative python3 (providing /usr/bin/python3).

Selection Path Priority Status

0 /usr/bin/python3.8 3 auto mode
1 /usr/bin/python3.6 1 manual mode

  • 2 /usr/bin/python3.6m 2 manual mode
    3 /usr/bin/python3.8 3 manual mode

Press to keep the current choice[*], or type selection number: Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (1.19.5)
Requirement already satisfied: opencv-python in /usr/local/lib/python3.6/dist-packages (4.5.4.58)
Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from opencv-python) (1.19.5)
root@fe9e26dca43b:/opt/nvidia/deepstream/deepstream#
root@fe9e26dca43b:/opt/nvidia/deepstream/deepstream#
root@fe9e26dca43b:/opt/nvidia/deepstream/deepstream#
root@fe9e26dca43b:/opt/nvidia/deepstream/deepstream#
root@fe9e26dca43b:/opt/nvidia/deepstream/deepstream# cd -
/opt
root@fe9e26dca43b:/opt# cd gst-python/
root@fe9e26dca43b:/opt/gst-python# ./autogen.sh PYTHON=python3

  • passing argument PYTHON=python3 to configure
  • options passed to configure: PYTHON=python3
  • check for build tools
    checking for autoconf >= 2.60 … found 2.69, ok.
    checking for automake >= 1.10 … found 1.16.1, ok.
    checking for libtoolize >= 1.5.0 … found 2.4.6, ok.
    checking for pkg-config >= 0.8.0 … found 0.29.1, ok.
  • running libtoolize --copy --force…
    libtoolize: putting auxiliary files in ‘.’.
    libtoolize: copying file ‘./ltmain.sh’
    libtoolize: putting macros in ‘m4’.
    libtoolize: copying file ‘m4/libtool.m4’
    libtoolize: copying file ‘m4/ltoptions.m4’
    libtoolize: copying file ‘m4/ltsugar.m4’
    libtoolize: copying file ‘m4/ltversion.m4’
    libtoolize: copying file ‘m4/lt~obsolete.m4’
    libtoolize: Consider adding ‘AC_CONFIG_MACRO_DIRS([m4])’ to configure.ac,
    libtoolize: and rerunning libtoolize and aclocal.
  • running aclocal -I m4 -I common/m4 …
  • running autoheader …
  • running autoconf …
  • running automake -a -c -Wno-portability…
    configure.ac:47: installing ‘./compile’
    configure.ac:13: installing ‘./missing’
    gi/overrides/Makefile.am: installing ‘./depcomp’
    plugin/Makefile.am:3: warning: ‘INCLUDES’ is the old name for ‘AM_CPPFLAGS’ (or ‘*_CPPFLAGS’)
  • running configure …
    ./configure default flags: --enable-maintainer-mode
    ./configure external flags: PYTHON=python3

checking build system type… x86_64-pc-linux-gnu
checking host system type… x86_64-pc-linux-gnu
checking target system type… x86_64-pc-linux-gnu
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /usr/bin/mkdir -p
checking for gawk… no
checking for mawk… mawk
checking whether make sets $(MAKE)… yes
checking whether make supports nested variables… yes
checking whether UID ‘0’ is supported by ustar format… yes
checking whether GID ‘0’ is supported by ustar format… yes
checking how to create a ustar tar archive… gnutar
checking nano version… 0 (release)
checking whether to enable maintainer-specific portions of Makefiles… yes
checking whether make supports nested variables… (cached) yes
checking how to print strings… printf
checking whether make supports the include directive… yes (GNU style)
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking whether gcc understands -c and -o together… yes
checking dependency style of gcc… gcc3
checking for a sed that does not truncate output… /usr/bin/sed
checking for grep that handles long lines and -e… /usr/bin/grep
checking for egrep… /usr/bin/grep -E
checking for fgrep… /usr/bin/grep -F
checking for ld used by gcc… /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld… yes
checking for BSD- or MS-compatible name lister (nm)… /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface… BSD nm
checking whether ln -s works… yes
checking the maximum length of command line arguments… 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format… func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format… func_convert_file_noop
checking for /usr/bin/ld option to reload object files… -r
checking for objdump… objdump
checking how to recognize dependent libraries… pass_all
checking for dlltool… no
checking how to associate runtime and link libraries… printf %s\n
checking for ar… ar
checking for archiver @FILE support… @
checking for strip… strip
checking for ranlib… ranlib
checking command to parse /usr/bin/nm -B output from gcc object… ok
checking for sysroot… no
checking for a working dd… /usr/bin/dd
checking how to truncate binary pipes… /usr/bin/dd bs=4096 count=1
checking for mt… no
checking if : is a manifest tool… no
checking how to run the C preprocessor… gcc -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for dlfcn.h… yes
checking for objdir… .libs
checking if gcc supports -fno-rtti -fno-exceptions… no
checking for gcc option to produce PIC… -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works… yes
checking if gcc static flag -static works… yes
checking if gcc supports -c -o file.o… yes
checking if gcc supports -c -o file.o… (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries… yes
checking whether -lc should be explicitly linked in… no
checking dynamic linker characteristics… GNU/Linux ld.so
checking how to hardcode library paths into programs… immediate
checking for shl_load… no
checking for shl_load in -ldld… no
checking for dlopen… no
checking for dlopen in -ldl… yes
checking whether a program can dlopen itself… yes
checking whether a statically linked program can dlopen itself… no
checking whether stripping libraries is possible… yes
checking if libtool supports shared libraries… yes
checking whether to build shared libraries… yes
checking whether to build static libraries… no
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ISO C89… (cached) none needed
checking whether gcc understands -c and -o together… (cached) yes
checking dependency style of gcc… (cached) gcc3
checking for gcc option to accept ISO C99… none needed
checking for gcc option to accept ISO Standard C… (cached) none needed
checking for python version… 3.6
checking for python platform… linux
checking for python script directory… ${prefix}/lib/python3.6/site-packages
checking for python extension module directory… ${exec_prefix}/lib/python3.6/site-packages
checking for python >= 2.7… checking for pkg-config… /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0… yes
checking for GST… yes
checking for PYGOBJECT… configure: error: Package requirements (pygobject-3.0 >= 3.8) were not met:

No package ‘pygobject-3.0’ found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables PYGOBJECT_CFLAGS
and PYGOBJECT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

configure failed

Hi @dilip.patel ,
Got! I can repro this, checking and will get back to you ASAP.

we are checking this.

One question, as a solution, is it ok for you to build the bindings for Python 3.8? The instructions is: deepstream_python_apps/bindings at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub

Hello @dilip.patel
Please follow the instructions below and let me know how it goes.

  1. Run the container using following command:

sudo docker run -it --rm --net=host --runtime nvidia -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --device /dev/video0 --privileged nvcr.io/nvidia/deepstream:6.0-triton

  1. After you are in the container, please run the script docker_python_setup.sh, it doesn’t require any other packages and should be able to setup python3.6 successfully in your container.

  2. Next, please clone the deepstream python repo at /opt/nvidia/deepstream/deepstream-6.0/sources/ and install the following required packages:

apt install python3-gi python3-gst-1.0 python-gi-dev git python3 python3-pip cmake g++ build-essential libglib2.0-dev python3-dev python3.6-dev libglib2.0-dev-bin python-gi-dev libtool m4 autoconf automake

Note: this installs gst-python so you don’t need to build it separately before building the bindings

  1. Follow the build instructions here: https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/tree/master/bindings#24—deepstream-sdk

  2. Make sure your default pip points to python3.6 and install the wheel you built in the above step using pip install ./pyds-1.1.0-py3-none-linux_x86_64.whl
    Note: If you see any errors in the installation which look like this: pip install ./pyds-1.1.0-py3-none-linux_x86_64.whl):
    /usr/bin/python3: can’t find ‘main’ module in ‘/usr/share/python-wheels/pep517-0.8.2-py2.py3-none-any.whl/pep517/_in_process.py’ ,
    Please try installing with the command below instead:
    pip install --no-use-pep517 ./pyds-1.1.0-py3-none-linux_x86_64.whl

Please let me know if you face any issues here.
Thanks

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