You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/installation.myst
+45-10Lines changed: 45 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,33 @@ kernelspec:
8
8
9
9
# Install instructions
10
10
11
-
We generally recommend creating a [conda](https://anaconda.org) environment to isolate any code
12
-
from other dependencies. The `ISLP` package does not have unusual dependencies, but this is still
13
-
good practice.
11
+
We generally recommend creating a Python environment to isolate any code from other dependencies. This can be done using either `uv` or `conda`. `uv` is a fast Python package installer and resolver, written in Rust, and can be used as a modern alternative to `conda` for environment management.
14
12
15
13
## Mac OS X / Linux
16
14
17
-
To create a Python conda environment in a Mac OS X or Linux environment run:
15
+
### Using `uv`
16
+
17
+
To create a Python environment using `uv` in a Mac OS X or Linux environment, first ensure `uv` is installed (e.g., `pip install uv`). Then run:
18
+
19
+
```{code-cell} ipython3
20
+
---
21
+
tags: [skip-execution]
22
+
---
23
+
uv venv islp
24
+
```
25
+
26
+
To run Python code in this environment, you must activate it:
27
+
28
+
```{code-cell} ipython3
29
+
---
30
+
tags: [skip-execution]
31
+
---
32
+
source islp/bin/activate
33
+
```
34
+
35
+
### Using `conda` (Alternative)
36
+
37
+
To create a Python conda environment in a Mac OS X or Linux environment run:
18
38
19
39
```{code-cell} ipython3
20
40
---
@@ -37,17 +57,32 @@ conda activate islp
37
57
38
58
## Windows
39
59
60
+
### Using `uv`
61
+
62
+
On Windows, you can create a Python environment called `islp` using `uv`. First, ensure `uv` is installed (e.g., `pip install uv`). Then, from a PowerShell terminal, run:
63
+
64
+
```{code-cell} ipython3
65
+
---
66
+
tags: [skip-execution]
67
+
---
68
+
uv venv islp
69
+
islp\Scripts\activate
70
+
```
71
+
72
+
### Using `conda` (Alternative)
73
+
40
74
On windows, create a `Python` environment called `islp` in the Anaconda app. This can be done by selecting `Environments` on the left hand side of the app's screen. After creating the environment, open a terminal within that environment by clicking on the "Play" button.
41
75
42
-
# Installing `ISLP`
76
+
# Installing `uv` and `ISLP`
43
77
44
-
Having completed the steps above, we use `pip` to install the `ISLP` package:
78
+
Having completed the steps above, we use `pip` to install `uv` and then `uv` to install `ISLP`:
45
79
46
80
```{code-cell} ipython3
47
81
---
48
82
tags: [skip-execution]
49
83
---
50
-
pip install ISLP
84
+
pip install uv
85
+
uv pip install ISLP
51
86
```
52
87
53
88
## Frozen environment
@@ -97,12 +132,12 @@ If JupyterLab is not already installed, run the following after having activated
97
132
---
98
133
tags: [skip-execution]
99
134
---
100
-
pip install jupyterlab
135
+
uv pip install jupyterlab
101
136
```
102
137
103
138
### Windows
104
139
105
-
Either use the same `pip` command above or install JupyterLab from the
140
+
Either use `pip install jupyterlab` or install JupyterLab from the
106
141
`Home` tab. Ensure that the environment is your `islp`
107
142
environment. This information appears near the top left in the
108
143
Anaconda `Home` page.
@@ -116,4 +151,4 @@ Colab](https://colab.research.google.com) with a few caveats:
116
151
Google Drive. See Google's [help](https://colab.research.google.com/notebooks/io.ipynb).
117
152
118
153
- The packages will have to be reinstalled each time a new runtime is started.
119
-
For most labs, inserting `pip install ISLP` at the top of the notebook will suffice, though Colab will ask you to restart after installation.
154
+
For most labs, inserting `pip install uv && uv pip install ISLP` at the top of the notebook will suffice, though Colab will ask you to restart after installation.
0 commit comments