quado executo o comando:
fig = px.line(dados_brasil, x='ano', y='imigrantes')
o codigo é executado sem problema, entretanto quando coloco fig.show() aparece esse problema:
{
"name": "ValueError",
"message": "Mime type rendering requires nbformat>=4.2.0 but it is not installed",
"stack": "---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[56], line 1
----> 1 fig.show(renderer='notebook')
File c:\\Users\\FMILETTO\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\plotly\\basedatatypes.py:3410, in BaseFigure.show(self, *args, **kwargs)
3377 \"\"\"
3378 Show a figure using either the default renderer(s) or the renderer(s)
3379 specified by the renderer argument
(...)
3406 None
3407 \"\"\"
3408 import plotly.io as pio
-> 3410 return pio.show(self, *args, **kwargs)
File c:\\Users\\FMILETTO\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\plotly\\io\\_renderers.py:394, in show(fig, renderer, validate, **kwargs)
389 raise ValueError(
390 \"Mime type rendering requires ipython but it is not installed\"
391 )
393 if not nbformat or Version(nbformat.__version__) < Version(\"4.2.0\"):
--> 394 raise ValueError(
395 \"Mime type rendering requires nbformat>=4.2.0 but it is not installed\"
396 )
398 ipython_display.display(bundle, raw=True)
400 # external renderers
ValueError: Mime type rendering requires nbformat>=4.2.0 but it is not installed"
}
mas a biblioteca está instalada:
PS C:\Users\FMILETTO\Área de Trabalho\cursos\alura\Data Visualisation\conhecendo as bibliotecas do python> pip show nbformat
Name: nbformat
Version: 4.2.0
Summary: The Jupyter Notebook format
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter@googlegroups.com
License: BSD
Location: C:\Users\FMILETTO\AppData\Local\Programs\Python\Python313\Lib\site-packages
Requires: ipython-genutils, jsonschema, jupyter-core, traitlets
Required-by: