Reputation: 860
I remote login a server using ssh -X ***@remote.arizona.edu
(This remote server is a Linux system) and tried to make some plots using Python, I had the following errors:
_tkinter.TclError: no display name and no $DISPLAY environment variable
Then I fixed this error by the adding the commands before I import any matplotlib
:
import matplotlib
matplotlib.use('Agg')
matplotlib.matplotlib_fname()
Now it runs well. But the problem is that there is no figure displayed even if I had the command plt.show()
. My old computer used Ubuntu 16.04 before, there is no such problem. Now I switched to MacBook Air, then I had this issue. It must be some Mac setting issues. Any thoughts to fix this issue?
Upvotes: 0
Views: 564