Home > Back-end >  How to run PyQt app on Raspberry pi startup?
How to run PyQt app on Raspberry pi startup?

Time:01-26

I want to run a python file containing GUI made on PyQt5 when the raspberry pi starts. I can run the file from terminal without any problems but it is a manual procedure. I tried following this post: PyQt: How to run GUI on Raspberry Pi desktop startup? but had no progress. My app won't start on raspberry pi startup.

Please note:

  • I have enabled auto login to Desktop.
  • PyQt5 is installed correctly.
  • I am able to run python script with terminal and the app opens fine.

Thanks,

Gurpreet

CodePudding user response:

I solved it by making a new python file. I ran this line:os.getcwd() which showed me the current directory in which program was running.

I found out that even thought my python file was placed in the /home/pi/Desktop directory, the program executed in the /home/pi directory and hence was searching for other files in the same directory.

So I moved all the program related files to the /home/pi directory and it started working as expected.

  •  Tags:  
  • Related