Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2481

Raspberry Pi OS • Re: raspberry pi 5 python script as service failed

$
0
0
You probably want to set WorkingDirectory to a directory where user pi has write rights and use the full path to the python of your venv.
For my blink.py in a venv in my_project, the service file has

Code:

... WorkingDirectory=/home/pi/my_project ExecStart=/home/pi/my_project/env/bin/python /home/pi/my_project/blink.py
It is on a Pi5 runing Bookworm 64-bit
It's better, but now i get this error:

Code:

juin 10 10:25:20 raspberrypi MasterVPN.sh[2281]:   File "/home/pi/Desktop/ManageVPN/Blink.py", line 4, in <module>juin 10 10:25:20 raspberrypi MasterVPN.sh[2281]:     import RPi.GPIO as GPIOjuin 10 10:25:20 raspberrypi MasterVPN.sh[2281]: ModuleNotFoundError: No module named 'RPi'

Statistics: Posted by lebossejames — Mon Jun 10, 2024 8:28 am



Viewing all articles
Browse latest Browse all 2481

Trending Articles