D
D
damq1n2020-01-14 12:35:17
linux
damq1n, 2020-01-14 12:35:17

Why doesn't autorun of a python program work with kivy?

Hello!
There is a python3 program using kivy, I registered it for autorun on raspberry in /etc/rc.local.
Specifically the line: sudo python3 /home/pi/pyt/untitled1.py &
raspbian is loaded in command line mode.
But for some reason, she does not want to start, she swears at the lack of kivy.
While you immediately run the program manually and it starts normally.
The program in autostart without kivy starts normally.
Sorry, the screen does not load on the site
https://yadi.sk/i/20Efx3fOUKNh9Q

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Barbolin, 2020-01-14
@dronmaxman

sudo vim /etc/systemd/system/untitled1service

[Service]
ExecStart=/usr/bin/kivy /home/pi/pyt/untitled1.py
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=untitled1
User=root
Group=root
WorkingDirectory= /home/pi/pyt/

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload
sudo systemctl enable untitled1.service
sudo systemctl start untitled1.service

D
damq1n, 2020-01-14
@damq1n

I tried to start with a 10 second delay, the result is the same.
I tried to write a program that will run the program I need:
import os
os.system('python3 ./pyt/untitled1.py')
The result is the same when autoloading the intermediary program and when manually starting the intermediary.
Although manually running untitled1.py is fine.

U
Umpiro, 2020-01-14
@Umpiro

There is an option that you have kivy installed under python2, not python3.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question