Firstly you should test with h264 file as described in readme file deepstream_python_apps/README at master · NVIDIA-AI-IOT/deepstream_python_apps (github.com).
If you still observe such issue with h264 file, please check whether your pyds is installed correctly. DeepStream SDK FAQ - #22 by mchi