Installing precompiled wheel for python deepstream bindings failed

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson Orin AGX
• DeepStream Version 6.2
• JetPack Version (valid for Jetson only) 5.1
• TensorRT Version 8.5.2-1+cuda11.4
• Issue Type( questions, new requirements, bugs) Failed to install pre-compiled wheel
**• How to reproduce the issue ? **

I have followed all steps described in this link.

But instead of compiling the bindings I downloaded the available precompiled wheels (https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/releases).

I tried:

pip3 install pyds-1.1.6-py3-none-linux_aarch64.whl

and got the following error:

Processing ./pyds-1.1.6-py3-none-linux_aarch64.whl
Collecting pgi (from pyds==1.1.6)
Using cached pgi-0.0.11.2.tar.gz (239 kB)
Preparing metadata (setup.py) … error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “/tmp/pip-install-5i4qqhg8/pgi_15dfafbdd8a64fa0a1bf4bfcb77b04cb/setup.py”, line 18, in
import pgi
File “/tmp/pip-install-5i4qqhg8/pgi_15dfafbdd8a64fa0a1bf4bfcb77b04cb/pgi/init.py”, line 10, in
from .importer import require_version, get_required_version
File “/tmp/pip-install-5i4qqhg8/pgi_15dfafbdd8a64fa0a1bf4bfcb77b04cb/pgi/importer.py”, line 15, in
from .clib.gir import GIRepository
File “/tmp/pip-install-5i4qqhg8/pgi_15dfafbdd8a64fa0a1bf4bfcb77b04cb/pgi/clib/gir/init.py”, line 9, in
from .gibaseinfo import GIInfoType, GIBaseInfo, GIAttributeIter
File “/tmp/pip-install-5i4qqhg8/pgi_15dfafbdd8a64fa0a1bf4bfcb77b04cb/pgi/clib/gir/gibaseinfo.py”, line 12, in
from .gitypelib import GITypelib
File “/tmp/pip-install-5i4qqhg8/pgi_15dfafbdd8a64fa0a1bf4bfcb77b04cb/pgi/clib/gir/gitypelib.py”, line 16, in
_gir = find_library(“girepository-1.0”)
File “/tmp/pip-install-5i4qqhg8/pgi_15dfafbdd8a64fa0a1bf4bfcb77b04cb/pgi/clib/_utils.py”, line 99, in find_library
_internal[name] = cdll.LoadLibrary(_so_mapping[name])
File “/home/nvidia/miniconda3/envs/torch/lib/python3.8/ctypes/init.py”, line 451, in LoadLibrary
return self._dlltype(name)
File “/home/nvidia/miniconda3/envs/torch/lib/python3.8/ctypes/init.py”, line 373, in init
self._handle = _dlopen(self._name, mode)
OSError: /lib/aarch64-linux-gnu/libgobject-2.0.so.0: undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

It looks like the package is missing, you install it first

sudo apt install libffi-dev
sudo apt install libglib2.0-0

If you can’t install it, update the environment and install it again

sudo apt update
sudo apt upgrade
sudo apt install libffi-dev
sudo apt install libglib2.0-0

Then install your package again

pip3 install pyds-1.1.6-py3-none-linux_aarch64.whl

Thanks for your repy @autodrive2022 .
@gbetsos , could you try the method that @autodrive2022 provided?

The packages are already installed, I got:

libffi-dev is already the newest version (3.3-4).
libglib2.0-0 is already the newest version (2.64.6-1~ubuntu20.04.4).

If the wheel installation fails, upgrade the pip using the following command:

python3 -m pip install --upgrade pip
sudo apt install --reinstall libffi7

try it.

Could you try to use the user_deepstream_python_apps_install.sh script from the release to install it?

I tried it, I get the same error.

I have already cloned deepstream_python_apps, so the script fails with

fatal: destination path ‘deepstream_python_apps’ already exists and is not an empty directory.

Could it be because you installed the package in the virtual environment created by conda?
I usually don’t use conda and use pip with the build environment directly, because although conda can install packages easily, the complex environment management may cause some subtle conflicts.
Since you already have conda installed, try installing the package with conda install, not pip install

conda install pyds-1.1.6-py3-none-linux_aarch64.whl

I got the following output:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  • pyds-1.1.6-py3-none-linux_aarch64.whl

Modify it according to your environment and add the following variables

export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libffi.so.7

Then install your package again

pip3 install pyds-1.1.6-py3-none-linux_aarch64.whl

1 Like

This worked, thanks!

I still cannot run the deepstream python apps though. When I try to run deepstream_test1 app I get:

Traceback (most recent call last):
File “deepstream_test_1.py”, line 23, in
import gi
File “/home/nvidia/miniconda3/lib/python3.8/site-packages/gi/init.py”, line 40, in
from . import _gi
ImportError: /lib/aarch64-linux-gnu/libgobject-2.0.so.0: undefined symbol: ffi_type_uint32, version LIBFFI_BASE_7.0
(base)

I think I am going to uninstall miniconda and try installing again.

I uninstalled miniconda, then rebuilt gst-python. Installing the pyds wheel worked right away without setting any env variables. The deepstream python apps also now work just fine.

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