My local machine and remote server are both Ubuntu. And I have succeed setting remote debugging in pycharm, all things work well excepting plotting figure.
I tried matplotlib but always failed to install pygtk or gtk package in conda py27 environment.
I also tried ssh -x and it works well in terminal. I can see figures on my local machine. But it is not convenient to work on both pycharm and terminal.. I didn't find where can set '-x' argument in pycharm, is it possible to do that? The codes always broke by errors no 'DISPLAY' Variable.
_tkinter.TclError: no display name and no $DISPLAY environment variable
I have checked "ForwardX11 yes". I tried to add 'DISPLAY' in pycharm environment, by setting "DISPLAY my_local_ip:0.0" but the program just suspend at the plotting step. it seems the figure has been plot somewhere? just not my local machine....
Any one know how to deal with such issues?
Test code:
from __future__ import print_function
import os
print("Display is: %s" % (os.environ['DISPLAY']))
import matplotlib
print("Default backend is: %s",matplotlib.get_backend())
matplotlib.use('TkAgg')
print("Backend is now: %s",matplotlib.get_backend())
from matplotlib import pyplot
pyplot.ioff()
pyplot.plot([1, 2, 3])
pyplot.show()