Why is pyplot giving me a TclError on osx?

倖福魔咒の 提交于 2019-12-06 22:52:31
Alfred Gao

I faced the same problem about 10 hours before. The problem was met after I followed the instruction in How to import matplotlib in virtual env

I found that I have installed the tk both in anacode and system. But I donot know the reason in callback in Tk. So what I did is change the backend of matplotlib.

cd ~/.matplotlib
vi matplotlibrc

then change

backend : TkAgg

to

backend : Qt4Agg

And it worked for me !

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!