MCPcopy Create free account
hub / github.com/plotly/plotly.py / display_jupyter_version_warnings

Function display_jupyter_version_warnings

plotly/io/_renderers.py:36–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35
36def display_jupyter_version_warnings():
37 parent_process = None
38 try:
39 psutil = optional_imports.get_module("psutil")
40 if psutil is not None:
41 parent_process = psutil.Process().parent().cmdline()[-1]
42 except Exception:
43 pass
44
45 if parent_process is None:
46 return
47 elif "jupyter-notebook" in parent_process:
48 jupyter_notebook = optional_imports.get_module("notebook")
49 if jupyter_notebook is not None and jupyter_notebook.__version__ < "7":
50 # Add warning about upgrading notebook
51 warnings.warn(
52 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`."
53 )
54 elif "jupyter-lab" in parent_process:
55 jupyter_lab = optional_imports.get_module("jupyterlab")
56 if jupyter_lab is not None and jupyter_lab.__version__ < "3":
57 # Add warning about upgrading jupyterlab
58 warnings.warn(
59 f"Plotly version >= 6 requires JupyterLab >= 3 but you have {jupyter_lab.__version__} installed. To upgrade JupyterLab, please run `pip install jupyterlab --upgrade`."
60 )
61
62
63# Renderer configuration class

Callers 2

_repr_mimebundle_Method · 0.90
showFunction · 0.85

Calls 1

parentMethod · 0.45

Tested by

no test coverage detected