Code that works when executed on Terminal does not work when launched as an App Debian/TI matrix GUI

I’m using CL-SOM-AM57x - TI AM5728 / AM5718 System-on-Module and load it with Ti’s matrix app launcher based on Linux Debian. I am trying to develop a python app which can be launched from TI Matrix GUI. With simple python code the app works fine in Terminal(loads and import openCV and numpy) but when I launch and run the App(have created Icon and the app is executing) from TI matrix GUI which doesn’t work properly and shows some errors/warnings in terminal. The App is opening and Prints on screen values but it looks like the OpenCV module and numpy is not loading or working properly.

So the issue is that the same code works on Terminal but not when launched in an App from TI matrix GUI.

sample code: