Skip to content

Commit ae0fbed

Browse files
authored
Merge pull request #5104 from plotly/jl-bug
Add handling for if jupyterlab / notebook isn't defined
2 parents 53c4770 + 856331c commit ae0fbed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plotly/io/_renderers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ def display_jupyter_version_warnings():
5050
return
5151
elif "jupyter-notebook" in parent_process:
5252
jupyter_notebook = optional_imports.get_module("notebook")
53-
if jupyter_notebook.__version__ < "7":
53+
if jupyter_notebook is not None and jupyter_notebook.__version__ < "7":
5454
# Add warning about upgrading notebook
5555
warnings.warn(
5656
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`."
5757
)
5858
elif "jupyter-lab" in parent_process:
5959
jupyter_lab = optional_imports.get_module("jupyterlab")
60-
if jupyter_lab.__version__ < "3":
60+
if jupyter_lab is not None and jupyter_lab.__version__ < "3":
6161
# Add warning about upgrading jupyterlab
6262
warnings.warn(
6363
f"Plotly version >= 6 requires JupyterLab >= 3 but you have {jupyter_lab.__version__} installed. To upgrade JupyterLab, please run `pip install jupyterlab --upgrade`."

0 commit comments

Comments
 (0)