I have a fully working docker-image running/hosted on my Ubuntu 18.04 linux machine. However, connecting to the physical machine via SSH from my Win10 Laptop via PowerShell:
ssh username@machine
I do get the following error from matplotlib when I try to execute my code remotely via ssh:
Traceback (most recent call last):
File "foo", line 284, in <module>
cnnTrainTestApply.applyStructureDetectionNet(absPathToCsvFiles, absPathToCnnOutputFiles)
File "/home/dev/foo.py", line 702, in bar
plt.figure(figsize=(15, 15))
File "/opt/conda/lib/python3.5/site-packages/matplotlib/pyplot.py", line 539, in figure
**kwargs)
File "/opt/conda/lib/python3.5/site-packages/matplotlib/backend_bases.py", line 171, in new_figure_manager
return cls.new_figure_manager_given_figure(num, fig)
File "/opt/conda/lib/python3.5/site-packages/matplotlib/backend_bases.py", line 177, in new_figure_manager_given_figure
canvas = cls.FigureCanvas(figure)
File "/opt/conda/lib/python3.5/site-packages/matplotlib/backends/backend_qt5agg.py", line 35, in __init__
super(FigureCanvasQTAggBase, self).__init__(figure=figure)
File "/opt/conda/lib/python3.5/site-packages/matplotlib/backends/backend_qt5.py", line 235, in __init__
_create_qApp()
File "/opt/conda/lib/python3.5/site-packages/matplotlib/backends/backend_qt5.py", line 122, in _create_qApp
raise RuntimeError('Invalid DISPLAY variable')
RuntimeError: Invalid DISPLAY variable
Neither this, nor ssh -X username@machine
do yield in success. Working directly on my machine without ssh does not make any issues. I suppose it is a missing XServer running, or something similar.
What do I get wrong about the ssh connection? How can I resolve the issue?
As matplotlib demands functioning qt5 backend, I can not simply avoid the forwarding of the X-server of the host system to docker.