I am using a Raspberry Pi 3 Model B Rev 1.2 running Raspbian 10 (Buster). I want to run a python script on startup that uses OpenVINO and OpenCV to detect objects and display a stream from a webcam.
I created a shell script launcher.sh
that contains
#!/bin/sh
/opt/inte/openvino/bin/setupvars.sh
/usr/bin/python3 /home/pi/project/run.py
I ran $ chmod 775 launcher.sh
and confirmed that the script works with $ sh launcher.sh
.
To run the script on start up I used $ sudo crontab -e
and added @reboot sh /home/pi/project/launcher.sh >/home/pi/logs/cronlog 2>&1
to the bottom.
The script does run on reboot. The logs show that the OpenVINO environment is initialized, but the logs also indicate I get a ModuleNotFoundError: No module named 'openvino'. I'm guessing it only works when i run it from the terminal because I have my bash.rc setting up the OpenVINO env each time.
What am I doing wrong? Is there a better way to do this on Buster?