1

I am running a python program from raspberry pi, which running this as text console mode. In normal desktop mode my program working, but when in text console mode, it says that

gtk-warning cannot open display

I want to run my program as autostart but it is not working. what is the solution??

SRKP
  • 11
  • 1
  • 3
  • To setup an autostart launcher, check this – Francesco Gusmeroli Jul 17 '17 at 13:55
  • most if not all gtk programs will require a desktop environment. Which is why it does not work from the command line but does from a terminal window. You need to launch your program using a method which does not run until the desktop is loaded, and you should probably boot to the desktop by default in that case. – Steve Robillard Jul 18 '17 at 02:02
  • so , opening an image using python from command line is not possible? – SRKP Jul 18 '17 at 05:17
  • This solved it for me: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=80848. Hope this helps. – Léonard Roussel Nov 11 '17 at 16:58

1 Answers1

1

this worked for me. Open a terminal (not in super user mode), write: gksudo and when a windows open write "lxterminal" from root. Then a new terminal will open and from there run your program.

Good luck!

pancho
  • 11
  • 1