Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotly 6.0 requires jupyterlab #5069

Closed
vilim opened this issue Mar 7, 2025 · 2 comments · Fixed by #5104
Closed

Plotly 6.0 requires jupyterlab #5069

vilim opened this issue Mar 7, 2025 · 2 comments · Fixed by #5104
Assignees
Labels
bug something broken P1 needed for current cycle regression this used to work

Comments

@vilim
Copy link

vilim commented Mar 7, 2025

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)

@gvwilson gvwilson added bug something broken P1 needed for current cycle regression this used to work labels Mar 7, 2025
@marthacryan
Copy link
Collaborator

Oh interesting! I can add handling for that case. Thanks for the issue

@vilim
Copy link
Author

vilim commented Mar 21, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P1 needed for current cycle regression this used to work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants