【问题标题】:AttributeError: module 'matplotlib' has no attribute 'interactive' [closed]AttributeError:模块'matplotlib'没有属性'interactive'[关闭]
【发布时间】:2020-02-19 14:31:10
【问题描述】:

在 Jupyter 笔记本中使用 %matplotlib inline 时出现错误:

AttributeError: 模块 'matplotlib' 没有属性 'interactive'

这是issue

我在stackoverflow也提到过这个问题 但我找不到答案。

我试过这个:

%matplotlib --list

发现了这个:

可用的 matplotlib 后端:['tk', 'gtk', 'gtk3', 'wx', 'qt4', 'qt5', 'qt', 'osx', 'nbagg', 'notebook', 'agg '、'svg'、'pdf'、'ps'、'inline'、'ipympl'、'widget']

它表明,我的 matplotlib 中有 inline 但无法使用它。

我也试过了:

import matplotlib.pyplot as plt

没有使用%matplotlib inline,而是发现了这个错误:

ModuleNotFoundError: 没有名为“matplotlib.pyplot”的模块

然后,我尝试在我的 conda venv 中安装此模块并收到此错误: error 请帮帮我:)

【问题讨论】:

    标签: python matplotlib jupyter-notebook


    【解决方案1】:

    我的解决方案是从我的 conda 环境中删除 matplot lib,这也强制删除了依赖项。 再次运行安装后:

    conda install -c conda-forge matplotlib
    

    一切都很好。

    【讨论】:

      【解决方案2】:

      我尝试了在所有论坛中找到的每个命令行。但是没有人为我工作。 然后我使用 pip install --upgrade matplotlib 。这对我有用。并解决这个问题 Jupyter Notebook

      【讨论】:

        猜你喜欢
        • 2018-04-29
        • 2019-01-28
        • 1970-01-01
        • 1970-01-01
        • 2019-04-24
        • 2020-12-22
        • 2018-04-02
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多