Skip to content

Commit ec2b8d8

Browse files
authored
Use the %pip magic
1 parent 2f44b00 commit ec2b8d8

20 files changed

+22
-102
lines changed

docs/source/examples/Beat Frequencies.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
"outputs": [],
2222
"source": [
2323
"# Imports for JupyterLite\n",
24-
"try:\n",
25-
" import piplite\n",
26-
" await piplite.install(['ipywidgets', 'matplotlib', 'numpy'])\n",
27-
"except ImportError:\n",
28-
" pass"
24+
"%pip install -q ipywidgets matplotlib numpy"
2925
]
3026
},
3127
{

docs/source/examples/Controller.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
"outputs": [],
2222
"source": [
2323
"# Imports for JupyterLite\n",
24-
"try:\n",
25-
" import piplite\n",
26-
" await piplite.install('ipywidgets')\n",
27-
"except ImportError:\n",
28-
" pass"
24+
"%pip install -q ipywidgets"
2925
]
3026
},
3127
{

docs/source/examples/Exploring Graphs.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
"outputs": [],
2222
"source": [
2323
"# Imports for JupyterLite\n",
24-
"try:\n",
25-
" import piplite\n",
26-
" await piplite.install(['ipywidgets', 'matplotlib', 'networkx'])\n",
27-
"except ImportError:\n",
28-
" pass"
24+
"%pip install -q ipywidgets matplotlib networkx"
2925
]
3026
},
3127
{

docs/source/examples/Factoring.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
"outputs": [],
2222
"source": [
2323
"# Imports for JupyterLite\n",
24-
"try:\n",
25-
" import piplite\n",
26-
" await piplite.install(['ipywidgets', 'sympy'])\n",
27-
"except ImportError:\n",
28-
" pass"
24+
"%pip install -q ipywidgets sympy"
2925
]
3026
},
3127
{

docs/source/examples/Image Browser.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
"outputs": [],
2222
"source": [
2323
"# Imports for JupyterLite\n",
24-
"try:\n",
25-
" import piplite\n",
26-
" await piplite.install(['ipywidgets', 'matplotlib', 'scikit-learn'])\n",
27-
"except ImportError:\n",
28-
" pass"
24+
"%pip install -q ipywidgets matplotlib scikit-learn"
2925
]
3026
},
3127
{

docs/source/examples/Image Processing.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
"outputs": [],
2222
"source": [
2323
"# Imports for JupyterLite\n",
24-
"try:\n",
25-
" import piplite\n",
26-
" await piplite.install(['ipywidgets', 'scikit-learn', 'numpy', 'matplotlib'])\n",
27-
"except ImportError:\n",
28-
" pass"
24+
"%pip install -q ipywidgets scikit-learn numpy matplotlib"
2925
]
3026
},
3127
{

docs/source/examples/Layout Example.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@
2828
"outputs": [],
2929
"source": [
3030
"# Imports for JupyterLite\n",
31-
"try:\n",
32-
" import piplite\n",
33-
" await piplite.install(['ipywidgets', 'ipyleaflet', 'numpy', 'bqplot', 'pandas'])\n",
34-
"except ImportError:\n",
35-
" pass"
31+
"%pip install -q ipywidgets ipyleaflet numpy bqplot pandas"
3632
]
3733
},
3834
{

docs/source/examples/Layout Templates.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
"outputs": [],
1717
"source": [
1818
"# Imports for JupyterLite\n",
19-
"try:\n",
20-
" import piplite\n",
21-
" await piplite.install(['ipywidgets', 'bqplot', 'numpy'])\n",
22-
"except ImportError:\n",
23-
" pass"
19+
"%pip install -q ipywidgets bqplot numpy"
2420
]
2521
},
2622
{

docs/source/examples/Lorenz Differential Equations.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@
4545
"outputs": [],
4646
"source": [
4747
"# Imports for JupyterLite\n",
48-
"try:\n",
49-
" import piplite\n",
50-
" await piplite.install(['ipywidgets', 'matplotlib', 'numpy', 'scipy'])\n",
51-
"except ImportError:\n",
52-
" pass"
48+
"%pip install -q ipywidgets matplotlib numpy scipy"
5349
]
5450
},
5551
{

docs/source/examples/Media widgets.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
"outputs": [],
1717
"source": [
1818
"# Imports for JupyterLite\n",
19-
"try:\n",
20-
" import piplite\n",
21-
" await piplite.install(['ipywidgets'])\n",
22-
"except ImportError:\n",
23-
" pass"
19+
"%pip install -q ipywidgets"
2420
]
2521
},
2622
{

0 commit comments

Comments
 (0)