您的位置:首页 > 编程语言 > Python开发

mac导入matplotlib报错:python is not installed as a framework

2018-03-21 14:38 513 查看
版本:python3.6import matplotlib.pyplot as plt报错:**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.
解决方法:1. 当pip安装matplotlib后会存在目录: ~/.matplotlib 2. 在上面的目录下新建一个文件并添加内容 文件:~/.matplotlib/matplotlibrc 文本内容:backend: TkAgg3. 保存后重新执行导入即可解决
该问题在stackoverflow的页面:https://stackoverflow.com/questions/21784641/installation-issue-with-matplotlib-python
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python matplotlib
相关文章推荐