标签: nbformat

ValueError: Mime 类型渲染需要 nbformat>=4.2.0 但未安装

我试图在 Visual Studio Code 中打印一个情节图并发现了这个错误:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-40-e07b5feb5ded> in <module>
     30 
     31 fig.update_layout(height=nrows*500)
---> 32 fig.show()

C:\Python38\lib\site-packages\plotly\basedatatypes.py in show(self, *args, **kwargs)
   3147         import plotly.io as pio
   3148 
-> 3149         return pio.show(self, *args, **kwargs)
   3150 
   3151     def to_json(self, *args, **kwargs):

C:\Python38\lib\site-packages\plotly\io\_renderers.py in show(fig, renderer, validate, **kwargs)
    383 
    384         if not nbformat or LooseVersion(nbformat.__version__) < LooseVersion("4.2.0"):
--> 385             raise ValueError(
    386                 "Mime type rendering requires nbformat>=4.2.0 but it is not installed"
    387             )

ValueError: Mime type rendering …
Run Code Online (Sandbox Code Playgroud)

python pandas plotly nbformat

8
推荐指数
3
解决办法
7464
查看次数

Plotly:找不到 mimetype“application/vnd.plotly.v1+json”的渲染器

环境:

  • 视觉代码
  • Jupyter 扩展 (v2022.9.1202862440)
  • 内核:Python 3.10.1 64位
  • pyplot 版本:5.10.0
  • Nb格式版本:5.7.0

发生了什么?

我正在尝试通过以下代码使用简单的箱线图plotly.express

#Basic vizualization
fig = px.box(dataset, y='Rh2')
fig.update_layout(
    height=1000
)
Run Code Online (Sandbox Code Playgroud)

第一个错误非常简单:ValueError: Mime type rendering requires nbformat>=4.2.0 but it is not installed我使用此答案解决了该错误。

第二个错误是我现在遇到的错误:

No renderer could be found for mimetype "application/vnd.plotly.v1+json", but one might be available on the Marketplace.
Run Code Online (Sandbox Code Playgroud)

我不知道在这里可以做什么 - 在互联网上没有提到这样的问题(至少我找不到任何)+市场空间也没有帮助!

提前致谢


编辑:

尝试添加:pio.renderers.default = "vscode"和其他各种内容,但它们不会导致错误,只是空白。

python pandas plotly nbformat

8
推荐指数
1
解决办法
3464
查看次数

标签 统计

nbformat ×2

pandas ×2

plotly ×2

python ×2