轉自:https://ask.csdn.net/questions/678355
今天在學
matplotlib
安裝成功後,執行程序時,報下面這個錯誤
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are Working with Matplotlib in a virtual enviroment see 'Working with Matplotlib in Virtual environments' in the Matplotlib FAQ
解決方法:
終端中執行如下命令,編輯一個文件
vim ~/.matplotlib/matplotlibrc
然後在文件中添加:
backend: TkAgg