Tkinter in Mac

I ran into issues with some python files from Udacity course in Machine Learning. The file uses the Tk library, which gives an error 'TclError'. I followed some online advice:

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 !

Worked for me too!