Compiling Deepstream 6.0 Python Bindings: pybind11.h: No such file or directory

I am trying to compile Deepstream 6.0 Python bindings:

sudo apt install -y git python-dev python3 python3-pip python3.6-dev python3.8-dev cmake g++ build-essential \
    libglib2.0-dev libglib2.0-dev-bin python-gi-dev libtool m4 autoconf automake
sudo apt-get -y install pybind11-dev
git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps.git
cd deepstream_python_apps
git checkout v1.1.0
cd bindings
mkdir build
cd build
cmake ..
make

I encounter the error:

ubuntu@ip-x-x-x-x:~/pycharm/libs/deepstream_python_apps/bindings/build$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/pycharm/libs/deepstream_python_apps/bindings/build
ubuntu@ip-x-x-x-x:~/pycharm/libs/deepstream_python_apps/bindings/build$ make
Scanning dependencies of target pyds
[  6%] Building CXX object CMakeFiles/pyds.dir/src/pyds.cpp.o
In file included from /home/ubuntu/pycharm/libs/deepstream_python_apps/bindings/include/bind/bindanalyticsmeta.hpp:23:0,
                 from /home/ubuntu/pycharm/libs/deepstream_python_apps/bindings/src/pyds.cpp:19:
/home/ubuntu/pycharm/libs/deepstream_python_apps/bindings/include/pyds.hpp:22:10: fatal error: pybind11.h: No such file or directory
 #include <pybind11.h>
          ^~~~~~~~~~~~
compilation terminated.
CMakeFiles/pyds.dir/build.make:62: recipe for target 'CMakeFiles/pyds.dir/src/pyds.cpp.o' failed
make[2]: *** [CMakeFiles/pyds.dir/src/pyds.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pyds.dir/all' failed
make[1]: *** [CMakeFiles/pyds.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

If I look for pybind11.h I can find it in:

/usr/include/pybind11/pybind11.h

Setup:

  • Ubuntu 18.04
  • Deepstream 6.0
  • 8.0.1.6
  • Tesla T4
  • Drivers 470.82.00
  • Cuda 11.4
1 Like

please refer to deepstream_python_apps/bindings at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub and steps below if you use DS6,0GA docker -

**1.  Prerequisites
# apt install -y git python-dev python3 python3-pip python3.6-dev python3.8-dev cmake g++ build-essential \
    libglib2.0-dev libglib2.0-dev-bin python-gi-dev libtool m4 autoconf automake

 **2. Gst-python
# cd /opt/nvidia/deepstream/deepstream/sources/apps/
# git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps.git
# cd deepstream_python_apps/
# git submodule update --init
# apt-get install --reinstall ca-certificates
# cd 3rdparty/gst-python/
# ./autogen.sh
# make
# make install

**3. install pyds
# cd deepstream_python_apps/bindings/
# mkdir build
# cd build
# cmake ..
# make
# pip3 install ./pyds-1.1.0-py3-none-linux_x86_64.whl

**4. run sample
# cd deepstream_python_apps
# mv  apps/* ./
# cd deepstream-test1/
# python3 deepstream_test_1.py ../../../../samples/streams/sample_qHD.h264
2 Likes

Note: autogen.sh is in folder 3rdparty/gst-python/ of the repository. ==> thanks!

git checkout v1.1.0 ==> maybe, it’s git checkout tags/v1.1.0
git submodule update --init ==> refer to Git - Submodules

Hi @mchi I guess you wanted to posted the message as a new one instead of modifying my message? :)
Do you think I should first do the checkout or the submodule update?

I guess you wanted to posted the message as a new one instead of modifying my message? :) ==> yes, sorry, my mistake. seems I can’t revert it now.

Do you think I should first do the checkout or the submodule update ? ==> no. just refer to the guide on deepstream_python_apps/bindings at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub , no need to checkout before submodule update

Let me rephrase my question: if I want to do a git checkout (to re-install the exact same version in the future) do you think I need to do it before the git submodule update --init or after it?

1 Like

after git submodule update --init

Thank you! I have been able to complete the installation successfully.

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