Forums

TclError when creating plots using mpld3 in pythonanywhere

Hi, I am creating plots using matplotlib and mpld3 (both successfully installed) but when plotting I got this error message: "...File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1767, in init#012 self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)#012TclError: no display name and no $DISPLAY environment variable". Any idea how to solve that? thanks for your help

Are you calling

import matplotlib
matplotlib.use("Agg")

...? More information on using matplotlib here.