Skip to content

Commit beaa0b4

Browse files
committed
Add better warning for no pandas
1 parent 586aeeb commit beaa0b4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/python/plotly/plotly/express/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@
22
`plotly.express` is a terse, consistent, high-level wrapper around `plotly.graph_objects`
33
for rapid data exploration and figure generation. Learn more at https://plotly.com/python/plotly-express/
44
"""
5+
56
from plotly import optional_imports
67

78
pd = optional_imports.get_module("pandas")
89
if pd is None:
910
raise ImportError(
1011
"""\
11-
Plotly express requires pandas to be installed."""
12+
Plotly Express requires pandas to be installed. You can install pandas using pip with:
13+
14+
$ pip install pandas
15+
16+
Or install Plotly Express and its dependencies directly with:
17+
18+
$ pip install plotly.express
19+
20+
You can also use Plotly Graph Objects to create a large number of charts without installing
21+
pandas. See examples here: https://plotly.com/python/graph-objects/
22+
"""
1223
)
1324

1425
from ._imshow import imshow

0 commit comments

Comments
 (0)