您当前的位置: 首页 >  Python

RuntimeError: Python is not installed as a framework

彭世瑜 发布时间:2018-05-06 23:04:43 ,浏览量:3

问题描述

引入 matplotlib 的时候

import matplotlib.pyplot as plt

报错如下:

Traceback (most recent call last):
File "", line 1, in 
...

in 
from matplotlib.backends import _macosx
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
解决方法

进入目录: ~/.matplotlib

创建一个名为matplotlibrc的文件,内容是:

backend: TkAgg

参考:

RuntimeError: Python is not installed as a framework 错误解决方案

关注
打赏
1688896170
查看更多评论

彭世瑜

暂无认证

  • 3浏览

    0关注

    2727博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0476s