Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on a windows machine, trying to run a python program on my lab's server, and would like to be able to see the output plots it produces. Here is what I type to try:

ssh –X user@server
import matplotlib
import matplotlib.pyplot as mp

The figure doesn't show up, and I get this error:

"Unable to access the X Display, is $DISPLAY set properly?"

Does anyone know how to make this work, or if it's even possible on a windows machine? Otherwise, any recommendations on how to get a look at the output data? I feel like this should be a very basic functionality, but I haven't found any solutions online yet and no one else in my lab uses windows.

share|improve this question

migrated from Jan 31 '13 at 16:47

This question came from our site for professional and enthusiast programmers.

Do you have an X server installed? – Raufio Jan 31 '13 at 15:48
And if you have an X server installed, have you actually started it. Since you're using Cygwin, you might have a menu item Cygwin-X -> XWin Server that you need to run first... – twalberg Jan 31 '13 at 15:57
voted to move to Super User. nothing actually to do with python – hometoast Jan 31 '13 at 16:00
Or maybe Server Fault ? Putty's support for SSH and X is pretty straingforward, check "enable X11 forwarding" in the SSH options. – ixe013 Jan 31 '13 at 16:04

You have to have X forwarding set up and have the cygwin X server installed and running.

First, install the cygwin X server using cygwin's setup.exe. Then, start it by typing startxwin in a cygwin shell. Then try your ssh again. If it still doesn't work, try ssh -Y user@server.

If it still doesn't work, you should make sure it's enabled in your ssh config: /etc/ssh_config

Look for the option ForwardX11 and enable it.

share|improve this answer

You must log in to answer this question.