Feb-03-2022, 06:36 PM
Yes it does :
pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# bash lancement.sh
root@raspberrypi:/home/pi# Traceback (most recent call last):
File "/home/pi/domoticz/scripts/snap2.py", line 1, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
then I try in lancement.sh :
cd /home/pi/domoticz/scripts
/usr/bin/python3 snap2.py&
and it gives back the same error
then in lancement.sh :
cd /home/pi/domoticz/scripts
/usr/bin/python snap2.py&
and same again.
cv2 is there :
pi@raspberrypi:~/.local/lib/python3.9/site-packages $ ls
cv2 opencv_python-4.5.4.60.dist-info
keyboard __pycache__
keyboard-0.13.5.dist-info python_vlc-3.0.12118.dist-info
numpy vlc.py
numpy-1.21.5.dist-info
and PATH looks correct :
pi@raspberrypi:~ $ echo $PATH
/home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/pi/.local/lib/python3.9/site-packages
So what should I change ?
pi@raspberrypi:~ $ sudo su
root@raspberrypi:/home/pi# bash lancement.sh
root@raspberrypi:/home/pi# Traceback (most recent call last):
File "/home/pi/domoticz/scripts/snap2.py", line 1, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
then I try in lancement.sh :
cd /home/pi/domoticz/scripts
/usr/bin/python3 snap2.py&
and it gives back the same error
then in lancement.sh :
cd /home/pi/domoticz/scripts
/usr/bin/python snap2.py&
and same again.
cv2 is there :
pi@raspberrypi:~/.local/lib/python3.9/site-packages $ ls
cv2 opencv_python-4.5.4.60.dist-info
keyboard __pycache__
keyboard-0.13.5.dist-info python_vlc-3.0.12118.dist-info
numpy vlc.py
numpy-1.21.5.dist-info
and PATH looks correct :
pi@raspberrypi:~ $ echo $PATH
/home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/pi/.local/lib/python3.9/site-packages
So what should I change ?