Google Compute Engine - Python Code Editor IDLE Display Issue

Viewed 100

I want to do some machine learning work on google compute engine instance. The OS is Ubuntu 14.04. I am connecting using SSH.

When I first ran the command 'idle' to open python editor, the outcome was

Traceback (most recent call last):
File "/usr/bin/idle", line 5, in <module>
main()
File "/usr/lib/python2.7/idlelib/PyShell.py", line 1537, in main
root = Tk(className="Idle")
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1767, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, 
wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

Afterwards, I searched on the internet and some suggestions said to export DISPLAY environment variable. This was the result.

aahmad@dna-linux-instance-1:~$ export DISPLAY=:0.0
aahmad@dna-linux-instance-1:~$ echo $DISPLAY
:0.0
aahmad@dna-linux-instance-1:~$ idle
Traceback (most recent call last):
File "/usr/bin/idle", line 5, in <module>
main()
File "/usr/lib/python2.7/idlelib/PyShell.py", line 1537, in main
root = Tk(className="Idle")
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1767, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, 
wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":0.0"

I have used IDLE on Ubuntu on my local machine and haven't had this issue before. This is new for me. Can someone please help?

Thank you for your time.

0 Answers
Related