Issue with running opencv program using a script

The jetson runs a dual camera program (imx219) using threading.
Example code - CSI-Camera/ at master · JetsonHacksNano/CSI-Camera · GitHub

It runs perfectly fine on vscode, but when I try to run it through a script I get an error which says it can’t identify the cameras.
Where the line174 in the error msg is equivalent to line 162 on the github code.

Traceback (most recent call last):
  File "/home/user1/", line 239, in <module>
  File "/home/user1/", line 174, in run_cameras
    success , left_image = #ISSUE HERE 
  File "/path/to/", line 85, in read
    frame = self.frame.copy()
AttributeError: 'NoneType' object has no attribute 'copy'

This is what my script file ( looks like in /usr/local/bin

#!/usr/bin/env python3

python3 /home/user1/

I also have a service file to autorun it in in /etc/systemd/system as mything.service

Description=mything: do my own thing



The autorun script itself works with a simple print current time program but not the opencv which is due to the system not finding the cameras which is where I am mainly stuck at.

Sorry for the late response, have you managed to get issue resolved or still need the support? Thanks

Please break into the python code to figure it out.