Skip to content

Commit 98da876

Browse files
committed
🐛 add dependency for static exports of images on colab
1 parent 2cfaea9 commit 98da876

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

2_plotly.ipynb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@
1515
"cell_type": "code",
1616
"execution_count": null,
1717
"id": "845ce912",
18-
"metadata": {},
18+
"metadata": {
19+
"tags": [
20+
"hide-output"
21+
]
22+
},
1923
"outputs": [],
2024
"source": [
21-
"import plotly.express as px"
25+
"import os\n",
26+
"import plotly.express as px\n",
27+
"\n",
28+
"IN_COLAB = \"COLAB_GPU\" in os.environ\n",
29+
"\n",
30+
"if IN_COLAB:\n",
31+
" !pip install kaleido"
2232
]
2333
},
2434
{

2_plotly.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
# - [website](https://plotly.com/python/plotly-express/)
66

77
# %%
8+
import os
89
import plotly.express as px
910

11+
IN_COLAB = "COLAB_GPU" in os.environ
12+
13+
if IN_COLAB:
14+
# !pip install kaleido
15+
1016
# %% [markdown]
1117
# ## Line Plot
1218
# - A simple line plot using Plotly Express.

0 commit comments

Comments
 (0)