Closed
Description
Since upgrading to Plotly 6.0, I get this error message:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File ~/.conda/envs/detektp/lib/python3.11/site-packages/IPython/core/formatters.py:925, in IPythonDisplayFormatter.__call__(self, obj)
923 method = get_real_method(obj, self.print_method)
924 if method is not None:
--> 925 method()
926 return True
File ~/.conda/envs/detektp/lib/python3.11/site-packages/plotly/basedatatypes.py:833, in BaseFigure._ipython_display_(self)
830 import plotly.io as pio
832 if pio.renderers.render_on_display and pio.renderers.default:
--> 833 pio.show(self)
834 else:
835 print(repr(self))
File ~/.conda/envs/detektp/lib/python3.11/site-packages/plotly/io/_renderers.py:429, in show(fig, renderer, validate, **kwargs)
424 if not nbformat or Version(nbformat.__version__) < Version("4.2.0"):
425 raise ValueError(
426 "Mime type rendering requires nbformat>=4.2.0 but it is not installed"
427 )
--> 429 display_jupyter_version_warnings()
431 ipython_display.display(bundle, raw=True)
433 # external renderers
File ~/.conda/envs/detektp/lib/python3.11/site-packages/plotly/io/_renderers.py:60, in display_jupyter_version_warnings()
58 elif "jupyter-lab" in parent_process:
59 jupyter_lab = optional_imports.get_module("jupyterlab")
---> 60 if jupyter_lab.__version__ < "3":
61 # Add warning about upgrading jupyterlab
62 warnings.warn(
63 f"Plotly version >= 6 requires JupyterLab >= 3 but you have {jupyter_lab.__version__} installed. To upgrade JupyterLab, please run `pip install jupyterlab --upgrade`."
64 )
AttributeError: 'NoneType' object has no attribute '__version__'
which I guess happens because jupyterlab itself is not installed in the notebook kernel environment (I use a separate jupyterlab installation in another environment, and multiple kernels that just have a ipykernel dependency)