Skip to content

Commit 62e5866

Browse files
update install instructions
1 parent d79747c commit 62e5866

1 file changed

Lines changed: 45 additions & 10 deletions

File tree

docs/source/installation.myst

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,33 @@ kernelspec:
88

99
# Install instructions
1010

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.
1412

1513
## Mac OS X / Linux
1614

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:
1838

1939
```{code-cell} ipython3
2040
---
@@ -37,17 +57,32 @@ conda activate islp
3757

3858
## Windows
3959

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+
4074
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.
4175

42-
# Installing `ISLP`
76+
# Installing `uv` and `ISLP`
4377

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`:
4579

4680
```{code-cell} ipython3
4781
---
4882
tags: [skip-execution]
4983
---
50-
pip install ISLP
84+
pip install uv
85+
uv pip install ISLP
5186
```
5287

5388
## Frozen environment
@@ -97,12 +132,12 @@ If JupyterLab is not already installed, run the following after having activated
97132
---
98133
tags: [skip-execution]
99134
---
100-
pip install jupyterlab
135+
uv pip install jupyterlab
101136
```
102137

103138
### Windows
104139

105-
Either use the same `pip` command above or install JupyterLab from the
140+
Either use `pip install jupyterlab` or install JupyterLab from the
106141
`Home` tab. Ensure that the environment is your `islp`
107142
environment. This information appears near the top left in the
108143
Anaconda `Home` page.
@@ -116,4 +151,4 @@ Colab](https://colab.research.google.com) with a few caveats:
116151
Google Drive. See Google's [help](https://colab.research.google.com/notebooks/io.ipynb).
117152

118153
- 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

Comments
 (0)