1

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
python
import matplotlib
matplotlib.use(‘WX’)
import matplotlib.pyplot as mp
mp.figure()

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.

4
  • 1
    Do you have an X server installed?
    – Raufio
    Jan 31, 2013 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, 2013 at 15:57
  • 1
    voted to move to Super User. nothing actually to do with python
    – hometoast
    Jan 31, 2013 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, 2013 at 16:04

1 Answer 1

1

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.

You must log in to answer this question.