PrincetonUniversity / DP_GP_cluster

BSD 3-Clause "New" or "Revised" License
73 stars 25 forks source link

"no display name..." error when plotting (in Windows Susystem for Linux) #22

Open sarahhp opened 4 years ago

sarahhp commented 4 years ago

When running the test with the --plot option I recieved an error: "_tkinter.TclError: no display name and no $DISPLAY environment variable". I am using the ubuntu application in Windows Subsystem for Linux (WSL) which by deafult has no graphical interface. I'm not familiar with configuring graphical setups for non-graphical environments like WSL or ssh but a quick google found that adding "matplotlib.use('Agg')" to a script should fix the general issue. See https://stackoverflow.com/questions/37604289/tkinter-tclerror-no-display-name-and-no-display-environment-variable.

So after finding the DG_GP_cluster.py file with "which DG_GP_cluster.py" all I had to do was uncomment the lines

import matplotlib matplotlib.use('Agg')

and the test data ran smoothly, producing the necessary pngs. I thought this might be helpful for other users :).