Failed to install Python Bindings

• Hardware Platform -Jetson nano
• DeepStream Version 6.0.1
• JetPack Version 4.6.1
• TensorRT Version 8.2

Error while trying to install python bindings from this link

After installing the pyds-1.1.1-py3-none-linux_aarch64.whl file from this link and after running the command:
$pip3 install pyds-1.1.1-py3-none-linux_aarch64.whl (from the same directory)

Here’s what I get:

Processing ./pyds-1.1.1-py3-none-linux_aarch64.whl
Collecting PyGObject (from pyds==1.1.1)
Using cached https://files.pythonhosted.org/packages/fe/40/9afaeb8d3b453fb8596fcb6c7bc2b64e434868c91eda19955742778eff74/PyGObject-3.42.2.tar.gz
Collecting pgi (from pyds==1.1.1)
Collecting pycairo>=1.16.0 (from PyGObject->pyds==1.1.1)
Building wheels for collected packages: PyGObject
Running setup.py bdist_wheel for PyGObject … error
Complete output from command /usr/bin/python3 -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-zeqf_as5/PyGObject/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” bdist_wheel -d /tmp/tmppx7fuu7lpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.6
creating build/lib.linux-aarch64-3.6/pygtkcompat
copying pygtkcompat/generictreemodel.py → build/lib.linux-aarch64-3.6/pygtkcompat
copying pygtkcompat/init.py → build/lib.linux-aarch64-3.6/pygtkcompat
copying pygtkcompat/pygtkcompat.py → build/lib.linux-aarch64-3.6/pygtkcompat
creating build/lib.linux-aarch64-3.6/gi
copying gi/_propertyhelper.py → build/lib.linux-aarch64-3.6/gi
copying gi/init.py → build/lib.linux-aarch64-3.6/gi
copying gi/_gtktemplate.py → build/lib.linux-aarch64-3.6/gi
copying gi/_option.py → build/lib.linux-aarch64-3.6/gi
copying gi/types.py → build/lib.linux-aarch64-3.6/gi
copying gi/_signalhelper.py → build/lib.linux-aarch64-3.6/gi
copying gi/_error.py → build/lib.linux-aarch64-3.6/gi
copying gi/pygtkcompat.py → build/lib.linux-aarch64-3.6/gi
copying gi/_constants.py → build/lib.linux-aarch64-3.6/gi
copying gi/importer.py → build/lib.linux-aarch64-3.6/gi
copying gi/module.py → build/lib.linux-aarch64-3.6/gi
copying gi/_ossighelper.py → build/lib.linux-aarch64-3.6/gi
copying gi/docstring.py → build/lib.linux-aarch64-3.6/gi
creating build/lib.linux-aarch64-3.6/gi/repository
copying gi/repository/init.py → build/lib.linux-aarch64-3.6/gi/repository
creating build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/Gdk.py → build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/init.py → build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/Gtk.py → build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/Gio.py → build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/keysyms.py → build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/GIMarshallingTests.py → build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/GLib.py → build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/GdkPixbuf.py → build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/Pango.py → build/lib.linux-aarch64-3.6/gi/overrides
copying gi/overrides/GObject.py → build/lib.linux-aarch64-3.6/gi/overrides
running build_ext
pycairo: trying include directory: ‘/usr/lib/python3/dist-packages/cairo/include’
pycairo: header file (‘/usr/lib/python3/dist-packages/cairo/include/py3cairo.h’) not found
pycairo: pkg-config
Package py3cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `py3cairo.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘py3cairo’ found
Command ‘(‘pkg-config’, ‘–print-errors’, ‘–exists’, ‘py3cairo >= 1.16.0’)’ returned non-zero exit status 1.


Failed building wheel for PyGObject
Running setup.py clean for PyGObject
Failed to build PyGObject
Installing collected packages: pycairo, PyGObject, pgi, pyds
Exception:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/usr/lib/python3/dist-packages/pip/commands/install.py”, line 360, in run
prefix=options.prefix_path,
File “/usr/lib/python3/dist-packages/pip/req/req_set.py”, line 784, in install
**kwargs
File “/usr/lib/python3/dist-packages/pip/req/req_install.py”, line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File “/usr/lib/python3/dist-packages/pip/req/req_install.py”, line 1064, in move_wheel_files
isolated=self.isolated,
File “/usr/lib/python3/dist-packages/pip/wheel.py”, line 247, in move_wheel_files
prefix=prefix,
File “/usr/lib/python3/dist-packages/pip/locations.py”, line 153, in distutils_scheme
i.finalize_options()
File “/usr/share/python-wheels/setuptools-39.0.1-py2.py3-none-any.whl/setuptools/command/install.py”, line 38, in finalize_options
orig.install.finalize_options(self)
File “/usr/lib/python3.6/distutils/command/install.py”, line 351, in finalize_options
self.create_home_path()
File “/usr/lib/python3.6/distutils/command/install.py”, line 581, in create_home_path
os.makedirs(path, 0o700)
File “/usr/lib/python3.6/os.py”, line 210, in makedirs
makedirs(head, mode, exist_ok)
File “/usr/lib/python3.6/os.py”, line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: ‘/home/nikhil/.local/lib/python3.6’

Need help to resolve this error.

The issue here is that your ~/.local/lib/python folder lacks the necessary permissions for your user. You can either resolve this by using the chown command or simply run the command with sudo.

@miguel.taylor So, should $sudo pip3 install pyds-1.1.1-py3-none-linux_aarch64.whl resolve the issue?

Also, can the pyds-1.1.1-py3-none-linux_aarch64.whl be placed on the deepstream directory or can it be placed in the Downloads directory while I run the above command?

After I run the command $sudo pip3 install pyds-1.1.1-py3-none-linux_aarch64.whl , do I still have to install the base dependencies?

Yes, that’ correct.

Also, can the pyds-1.1.1-py3-none-linux_aarch64.whl be placed on the deepstream directory or can it be placed in the Downloads directory while I run the above command?

The Python wheel is basically a .zip that contains all the necessary files to install (or in some cases build) a python package, you can place it anywhere.

After I run the command $sudo pip3 install pyds-1.1.1-py3-none-linux_aarch64.whl , do I still have to install the base dependencies?

Wheels have a list of required packages that will be installed with pip. However, any dependencies that cannot be installed with pip should be installed manually

Ive installed the .whl file and runnig the command print(pyds.__version__)" returns the version number 1.1.1 , I also ran the sample deepstream_test_1.py , and was able to get the expected output.

1 Like

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