Skip to content Skip to sidebar Skip to footer

Python Plotting On Remote Server Using Pycharm

I have started to learn Python and so far my setup has been following - Python 3.5 installation on Win10 64bit local machine with PyCharm as a great IDE. Everything works, matplotl

Solution 1:

Ok, after some more googling I finally managed to get this process working, hope it helps somebody:

1) on remote host (VPS, Ubuntu 16.04) I had to install X11 server, which I did by:

sudo apt-get install xorg
sudo apt-get install openbox

2) On remote host I had to make sure that X11Forwarding is enabled in /etc/ssh/sshd_config

3) On local Win10 machine I had to install Xming server and launch it with default settings.

4) On local Win10 machine I had to configure Putty to use X11 forwarding (Connection-> SSH -> X11 Forwarding) with default settings and keep connection open while running PyCharm (it seems there is no option in PyCharm to enable x11 forwarding, so putty must be running in the background)

5) On remote machine I had to check Display number (echo $DISPLAY) - this can be different for everyone. For me it was localhost:10.0

6) In PyCharm Run configuration -> Environment variables I had to add DISPLAY=localhost:10.0

After all these steps and Putty+Xming running in backgroud, I was able to execute remote code and bring graphic back to my Windows 10 PC!

PS - process is actually slow, I have to wait around 10 seconds before image is brought back to me. I am not sure why or how to speed it up. Might be another question. (reducing chipher strength and enabling compression does not help. It seems some sort of initialization problem with x11 remote and local)

Solution 2:

Mac user should install XQuartz instead of Xming.

And another important thing: if you install xquartz via homebrew, you should relogin your macos or reboot.

As the rackpas's answer saying.

Post a Comment for "Python Plotting On Remote Server Using Pycharm"