Skip to content

Commit a3ecf91

Browse files
committed
Fix psutil import error
1 parent 4d99b35 commit a3ecf91

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: packages/python/plotly/plotly/io/_renderers.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@
3535
from plotly import optional_imports
3636

3737
import warnings
38-
import psutil
3938

4039

4140
def display_jupyter_version_warnings():
4241
parent_process = None
4342
try:
44-
parent_process = psutil.Process().parent().cmdline()[-1]
43+
psutil = optional_imports.get_module("psutil")
44+
if psutil is not None:
45+
parent_process = psutil.Process().parent().cmdline()[-1]
4546
except Exception:
4647
pass
4748

0 commit comments

Comments
 (0)