开发者社区> 问答> 正文

Anaconda运行时错误:未将Python安装为框架吗?

我已经使用pkg安装程序安装了Anaconda:

Python 2.7.10 |Continuum Analytics, Inc.| (default, May 28 2015, 17:04:42) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org

但是当我尝试使用matplotlib中的任何东西时,即:

from matplotlib import 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.

我真的不确定这意味着什么,或者如何解决它。

展开
收起
祖安文状元 2020-02-22 18:25:33 1060 0
2 条回答
写回答
取消 提交回答
  • conda install matplotlib

    2020-03-05 20:20:50
    赞同 展开评论 打赏
  • 由于我刚遇到这个问题,因此发布了一个快速解决方法:

    如果您使用pip进行安装:

    创建 ~/.matplotlib/matplotlibrc

    backend: TkAgg在文件中添加“ ”(不带引号)。

    2020-02-22 18:25:57
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载