Unable to import pyds - cannot open shared object file

Hardware Platform: Jetson
DeepStream Version: 5.1
JetPack Version: 4.5.1
Issue Type: questions

I have followed all the instructions to setup the python binding for the deepstream. However, stuck in the initial execution while importing the pyds. Not sure what I am missing here. Any help is much appreciated.

> root@jetson:/opt/nvidia/deepstream/deepstream/lib# python3 setup.py install
> running install
> running build
> running build_py
> running install_lib
> copying build/lib/pyds.so -> /usr/local/lib/python3.6/dist-packages
> running install_egg_info
> Writing /usr/local/lib/python3.6/dist-packages/pyds-1.0.2.egg-info
> root@jetson:/opt/nvidia/deepstream/deepstream/lib# cd ..
> root@jetson:/opt/nvidia/deepstream/deepstream# cd sources/deepstream_python_apps/apps/deepstream-test1-rtsp-out/
> root@jetson:/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-test1-rtsp-out# python3 deepstream_test1_rtsp_out.py -i rtsp://url -p 8554
> (print(sys.path))['/opt/nvidia/deepstream/deepstream-5.1/sources/deepstream_python_apps/apps/deepstream-test1-rtsp-out', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.6/dist-packages', '../']
> Traceback (most recent call last):
>   File "deepstream_test1_rtsp_out.py", line 36, in <module>
>     import pyds
> ImportError: /usr/local/lib/python3.6/dist-packages/pyds.so: cannot open shared object file: No such file or directory
> root@jetson:/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-test1-rtsp-out#

Have you done the steps in Python Sample Apps Source Details — DeepStream 5.1 Release documentation?

And the deepstream_test1_rtsp_out.py command line should be:

python3 deepstream_test1_rtsp_out.py -i <h264_elementary_stream>

It can not be rtsp uri.

I can not reproduce your error in my board.

Thanks for the reply. Yes I have done all that is listed in that documentation link.

In my case, the input itself is an rtsp stream, and i also want to stream the output as well to rtsp. I checked with the deepstream-app compiled executable and this works fine. I am trying to do same using python binding so i can make some changes that I want to do.

But i think I have not gone that far. The initial loading of the pyds itself is an issue. I checked if this is an path issue, but I can see pyds.so in /usr/local/lib/python3.6/dist-packages/ and also the sys.path includes this location as well. Still it wont import.