I have an error when I run the matplotlib after the first installation.
1 Import Matplotlib as MLB 2 from Import Pylab as PL 3 4 5 x = [1,3,5,7,6,9,10,13,16]6 y = [3,4,5,7,9,0,1,2,3]78 pl.plot (x, y)9 pl.show ()
Error content
Runtimeerror:python is not installed as a framework. The Mac OS X backend'll isn't able to function correctly if Python was not installed as a framework. See the Python documentation for more information on installing Python as a framework on MAC OS X. Either reinstall Python as a framework, or try one of the other backends. If you is using (Ana) Conda Please install Python.app and replace the use of ' Python ' with ' pythonw '. See ' Working with Matplotlib on OSX ' in the Matplotlib FAQs for more information.
Workaround:
1. Open terminal, enter CD ~/.matplotlib
2. New file, vi MATPLOTLIBRC
3, add the contents of the file, press the I key, then enter the content Backend:tkagg, then click ESC, enter: Number, enter Wq, and then enter OK
4. Rerun the script
The results are as follows:
Matplotlib using the Times error Runtimeerror:python is not installed as a framework