解決Python is not installed as a framework. The Mac OS X backend will not be able to function (轉)

轉自: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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章