解决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

 

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