I am using the mac OS X Yosemite 10.10.1, I have installed matplotlib using pip install matplotlib.
I tried a simple application as below.
import matplotlib.pyplot as plt
plt.plot([1,2,3,4], [1,4,9,16], 'ro')
plt.axis([0, 6, 0, 20])
plt.show()
the python application runs and show the window, but without any graph. The command line just gave me a error saying:
Class TKApplication is implemented in both /Users/xisizhe/anaconda/lib/libtk8.5.dylib and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
Class TKMenu is implemented in both /Users/xisizhe/anaconda/lib/libtk8.5.dylib and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
Class TKContentView is implemented in both /Users/xisizhe/anaconda/lib/libtk8.5.dylib and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
Class TKWindow is implemented in both /Users/xisizhe/anaconda/lib/libtk8.5.dylib and /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two will be used. Which one is undefined.
How can I choose one of the two ?
I had the same problem so my solution was to just not use Tk for the backend after not being able to resolve the issue quickly. Looks like a periodic issue when using Anaconda based on the many threads I found while looking for a solution.
I used this to find available backends
python -c "import matplotlib; print matplotlib.rcsetup.all_backends"
Then added the following to ~/.matplotlib/matplotlibrc
to use the Qt4 backend
backend:Qt4Agg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With