【问题标题】:Plotly Figure not Working: NBformat installing problemPlotly Figure 不工作:NBformat 安装问题
【发布时间】:2023-02-07 14:59:20
【问题描述】:

我开始冒险进入 Plotly 图书馆。 我在VSCode中创建了一个简单的图开始分析,如下:

import plotly
import plotly.graph_objects as go

fig=go.Figure(
    data=[go.Bar(x=[1,2,3],y=[1,2,3])],
    layout=go.Layout(
        title=go.layout.Title(text='A figure specified by a graph object')
    )
)

应用fig.show() 终端后显示以下错误: ValueError: Mime 类型渲染要求 nbformat>=4.2.0 但未安装

我已经在 Anaconta Prompt 中安装了 nbformat 并对其进行了更新,但我不知道为什么它不起作用。

【问题讨论】:

  • 尝试像这样升级它:pip install nbformat --upgrade

标签: python anaconda plotly


【解决方案1】:

我相信解决方案非常简单。

pip install --upgrade nbformat

或者

!pip install nbformat 

或者沿着那些重置内核的路线。其他人以前也遇到过这个问题。看看这个link

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-19
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    • 2016-01-01
    • 1970-01-01
    • 2013-07-14
    • 2018-05-07
    相关资源
    最近更新 更多