Some_Guy
Posts: 15
Joined: Wed Dec 31, 2014 6:44 am

Errors with sudo idle

Mon Feb 23, 2015 4:27 am

I'm trying to run idle as a superuser from the desktop (where I'm just logged in as pi), and I'm getting the following:

Code: Select all

pi@raspberrypi ~ $ sudo idle
Invalid MIT-MAGIC-COOKIE-1 keyTraceback (most recent call last):
  File "/usr/bin/idle", line 5, in <module>
    main()
  File "/usr/lib/python2.7/idlelib/PyShell.py", line 1427, in main
    root = Tk(className="Idle")
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1712, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":0.0"
I do not understand what any of this means. But if I just run idle, it comes up fine. Does anyone know how to get this to work properly?

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Errors with sudo idle

Mon Feb 23, 2015 7:57 am

Try with gksudo idle instead.

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Errors with sudo idle

Mon Feb 23, 2015 9:03 am

B.Goode wrote:Try with gksudo idle instead.
You may need to install it:-

Code: Select all

sudo apt-get update
sudo apt-get install gksu

Some_Guy
Posts: 15
Joined: Wed Dec 31, 2014 6:44 am

Re: Errors with sudo idle

Fri Feb 27, 2015 2:41 am

Thanks!

Return to “Python”