Hi all, I have a problem with my server machine and matplotlib. I connect to centos server machine enabling x11Forwarding and I have on windows Xming. When I run on server machine (connecting with putty) the simple test code:
import matplotlib matplotlib.use('TKAgg') import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show()
I obtain the following error:
import matplotlib.pyplot as plt File "/usr/local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 2500, in <module> switch_backend(rcParams["backend"]) File "/usr/local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 285, in switch_backend raise ImportError( ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running
the same when I connect with VScode with the following ssh configurations:
Host 192.168.1.10
HostName 192.168.1.10
User root
Port 22
IdentityFile C:\Users.ssh\id_rsa
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
thank you very much for your help
Best regards