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
This PR improves installation documentation with clearer instructions
for uv add workflow.
Changes:
- Add detailed instructions for uv add installation method.
- Add troubleshooting tips for Windows MarkupSafe installation issues
with `uv add` installation workflow.
- Add note about `uv sync --upgrade` to update dependencies for local
development builds.
- Update pytorch cuda wheel links
@@ -68,7 +69,7 @@ We use `uvx` here which automatically installs sleap-nn from PyPI with all depen
68
69
69
70
!!! info
70
71
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
71
-
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
72
+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cu118` for CUDA 11.8, `https://download.pytorch.org/whl/cu128` for CUDA 12.8, etc.).
72
73
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
73
74
74
75
@@ -93,7 +94,7 @@ To run inference:
93
94
94
95
!!! info
95
96
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
96
-
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
97
+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cu118` for CUDA 11.8, `https://download.pytorch.org/whl/cu128` for CUDA 12.8, etc.).
97
98
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
Copy file name to clipboardExpand all lines: docs/installation.md
+46-47Lines changed: 46 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,32 @@
1
1
# Installation
2
2
3
-
**Prerequisites:** Python 3.11+ (required for all installation methods)
3
+
**Prerequisites:**
4
+
5
+
Python 3.11 (or) 3.12 (or) 3.13 (required for all installation methods)
4
6
5
7
!!! warning "Python 3.14 is not yet supported"
6
8
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.** If you have Python 3.14 installed, you must specify the Python version in all `uv` install commands by adding `--python 3.13`.
Replace `...` with the rest of your install command as needed.
12
24
25
+
13
26
!!! tip "Choose Your Installation Method"
14
27
- **[Installation as a system-wide tool with uv](#installation-as-a-system-wide-tool-with-uv)**: **(Recommended)** Use `uv tool install` to install sleap-nn globally as a CLI tool
15
28
- **[Installation with uvx](#installation-with-uvx)**: Use `uvx` for one-off commands (no installation needed)
16
-
- **[Installation with uv add](#installation-with-uv-add)**: Use `uv add` to install sleap-nn as a dependency in a uv virtual env.
29
+
- **[Installation with uv add](#installation-with-uv-add)**: Use `uv add` to install sleap-nn as a dependency in a uv virtual env. (useful for project-specific workspaces)
17
30
- **[Installation with pip](#installation-with-pip)**: Use `pip` to install from pypi in a conda env. (Recommended to use with a conda env)
18
31
- **[Installation from source](#installation-from-source)**: Use `uv sync` to install from source (for developmental purposes)
19
32
@@ -35,14 +48,6 @@
35
48
36
49
### Platform-Specific Installation
37
50
38
-
!!! warning "Python 3.14 is not yet supported"
39
-
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.** If you have Python 3.14 installed, you must specify the Python version in the install commands by adding `--python 3.13`.
Replace `...` with the rest of your install command as needed.
45
-
46
51
=== "Windows/Linux (CUDA)"
47
52
```bash
48
53
# CUDA 12.8
@@ -64,7 +69,7 @@
64
69
65
70
!!! info
66
71
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
67
-
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
72
+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cu118` for CUDA 11.8, `https://download.pytorch.org/whl/cu128` for CUDA 12.8, etc.).
68
73
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
69
74
70
75
### Verify installation
@@ -92,14 +97,6 @@ sleap-nn --help
92
97
93
98
### Platform-Specific Commands
94
99
95
-
!!! warning "Python 3.14 is not yet supported"
96
-
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.** If you have Python 3.14 installed, you must specify the Python version in the install commands by adding `--python 3.13`.
97
-
For example:
98
-
```bash
99
-
uvx --python 3.13 ...
100
-
```
101
-
Replace `...` with the rest of your install command as needed.
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
123
-
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
120
+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cu118` for CUDA 11.8, `https://download.pytorch.org/whl/cu128` for CUDA 12.8, etc.).
124
121
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
125
122
126
-
!!! tip "How uvx Works"
127
-
- **Automatic Installation**: Downloads and installs sleap-nn with dependencies
128
-
- **Isolated Environment**: Each command runs in a clean, temporary environment
129
-
- **No Conflicts**: Won't interfere with your existing Python packages
130
-
- **Uses recent pkgs**: Uses the latest version from PyPI
131
-
132
123
!!! note "uvx Installation"
133
124
Because `uvx` installs packages fresh on every run, it's ideal for quick tests or use in remote environments. For regular use, you could install with [`uv tool install`](#installation-as-a-system-wide-tool-with-uv) or setting up a development environment with [`uv sync`](#installation-from-source) to avoid repeated downloads.
134
125
@@ -138,14 +129,6 @@ sleap-nn --help
138
129
139
130
This method creates a dedicated project environment using uv's modern Python project management. It initializes a new project with `uv init`, creates an isolated virtual environment with `uv venv`, and adds sleap-nn as a dependency using `uv add`. To use all installed packages, you must run commands with `uv run` (e.g., `uv run sleap-nn train ...` or `uv run pytest ...`).
140
131
141
-
!!! warning "Python 3.14 is not yet supported"
142
-
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.**`uv` will use the system-installed python by default. If you have python 3.14 installed on your system, then specify the Python version (<=3.13) in the venv command.
143
-
For example:
144
-
```bash
145
-
uv venv --python 3.13 ...
146
-
```
147
-
Replace `...` with the rest of your install command as needed.
148
-
149
132
!!! note "Install and set-up uv"
150
133
Step-1: Install [`uv`](https://github.com/astral-sh/uv) - a fast Python package manager:
151
134
```bash
@@ -167,18 +150,34 @@ This method creates a dedicated project environment using uv's modern Python pro
167
150
!!! tip "How `uv add` works"
168
151
- When you run `uv init`, it creates a `pyproject.toml` file in your working directory to manage your project's dependencies.
169
152
- When you use `uv add sleap-nn[torch]`, it adds `sleap-nn[torch]` as a dependency in your `pyproject.toml` and installs it in your virtual environment.
170
-
- To add other packages, simply run `uv add <package>`. After adding new packages, you should run `uv sync` to update your environment with all dependencies specified in `pyproject.toml`.
153
+
- To add other packages, simply run `uv add <package>`. After adding new packages, you should run `uv sync` to update your environment with all dependencies specified in `pyproject.toml`. (or `uv sync --upgrade` to update all dependencies)
171
154
- To install a local package (such as a local clone of sleap-nn) in editable mode, use:
172
155
```bash
173
-
uv add --editable "./sleap-nn[torch]" ...
156
+
uv add --editable "path/to/sleap-nn[torch]" ...
174
157
```
175
158
This is useful for development, as changes to the code are immediately reflected in your environment.
On **Windows**, you may encounter errors when running `uv add "sleap-nn[torch]" --index ...` due to an incompatibility with the MarkupSafe wheel (e.g., "failed to install MarkupSafe" or similar errors).
162
+
Similar issues: [#11532](https://github.com/astral-sh/uv/issues/11532) and [#12620](https://github.com/astral-sh/uv/issues/12620).
163
+
164
+
**Workaround:**
165
+
Before running `uv add "sleap-nn[torch]" ...` on Windows, manually install a compatible version of MarkupSafe:
@@ -196,7 +195,7 @@ This method creates a dedicated project environment using uv's modern Python pro
196
195
197
196
!!! info
198
197
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
199
-
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
198
+
The `--index` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cu118` for CUDA 11.8, `https://download.pytorch.org/whl/cu128` for CUDA 12.8, etc.).
200
199
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
201
200
202
201
### Verify Installation
@@ -257,7 +256,7 @@ conda activate sleap-nn-env
257
256
258
257
!!! info
259
258
- For more information on which CUDA version to use for your system, see the [PyTorch installation guide](https://pytorch.org/get-started/locally/).
260
-
The `--extra-index-url` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cuda118` for CUDA 11.8, `https://download.pytorch.org/whl/cuda128` for CUDA 12.8, etc.).
259
+
The `--extra-index-url` in the install command should match the CUDA version you need (e.g., `https://download.pytorch.org/whl/cu118` for CUDA 11.8, `https://download.pytorch.org/whl/cu128` for CUDA 12.8, etc.).
261
260
- On macOS, MPS (Metal Performance Shaders) is automatically enabled for Apple Silicon acceleration.
262
261
263
262
@@ -301,14 +300,6 @@ cd sleap-nn
301
300
302
301
#### 3. Install Dependencies
303
302
304
-
!!! warning "Python 3.14 is not yet supported"
305
-
`sleap-nn` currently supports **Python 3.11, 3.12, and 3.13**. **Python 3.14 is not yet tested or supported.**`uv` will use the system-installed python by default. If you have python 3.14 installed on your system, then specify the Python version (<=3.13) in the installation command.
306
-
For example:
307
-
```bash
308
-
uv sync --python 3.13 ...
309
-
```
310
-
Replace `...` with the rest of your install command as needed.
311
-
312
303
=== "Windows/Linux (CUDA 11.8)"
313
304
```bash
314
305
uv sync --extra dev --extra torch-cuda118
@@ -324,6 +315,14 @@ cd sleap-nn
324
315
uv sync --extra dev --extra torch-cpu
325
316
```
326
317
318
+
!!! tip "Upgrading All Dependencies"
319
+
To ensure you have the latest versions of all dependencies, use the `--upgrade` flag with `uv sync`:
320
+
```bash
321
+
uv sync --extra dev --upgrade
322
+
```
323
+
This will upgrade all installed packages in your environment to the latest available versions compatible with your `pyproject.toml`.
0 commit comments