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

Add handling for if jupyterlab / notebook isn't defined #5104

Merged
merged 2 commits into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plotly/io/_renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ def display_jupyter_version_warnings():
return
elif "jupyter-notebook" in parent_process:
jupyter_notebook = optional_imports.get_module("notebook")
if jupyter_notebook.__version__ < "7":
if jupyter_notebook is not None and jupyter_notebook.__version__ < "7":
# Add warning about upgrading notebook
warnings.warn(
f"Plotly version >= 6 requires Jupyter Notebook >= 7 but you have {jupyter_notebook.__version__} installed.\n To upgrade Jupyter Notebook, please run `pip install notebook --upgrade`."
)
elif "jupyter-lab" in parent_process:
jupyter_lab = optional_imports.get_module("jupyterlab")
if jupyter_lab.__version__ < "3":
if jupyter_lab is not None and jupyter_lab.__version__ < "3":
# Add warning about upgrading jupyterlab
warnings.warn(
f"Plotly version >= 6 requires JupyterLab >= 3 but you have {jupyter_lab.__version__} installed. To upgrade JupyterLab, please run `pip install jupyterlab --upgrade`."
Expand Down