Skip to content

Commit 7bf940f

Browse files
committed
updated installation guide
1 parent 3a0ce9d commit 7bf940f

File tree

2 files changed

+118
-53
lines changed

2 files changed

+118
-53
lines changed

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@
219219
"via": "https://www.robots.ox.ac.uk/~vgg/software/via/{{path}}#{{fragment}}",
220220
"anipose": "https://anipose.readthedocs.io/en/latest/",
221221
"TRex": "https://trex.run/docs/",
222+
"uv": "https://docs.astral.sh/uv/{{path}}#{{fragment}}",
222223
}
223224

224225
intersphinx_mapping = {
Lines changed: 117 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,115 @@
11
(target-installation)=
22
# Installation
33

4-
## Install the package
5-
:::{admonition} Use a conda environment
6-
:class: note
7-
To avoid dependency conflicts with other packages, it is best practice to install Python packages within a virtual environment.
8-
We recommend using [conda](conda:) or [mamba](mamba:) to create and manage this environment, as they simplify the installation process.
9-
The following instructions assume that you have conda installed, but the same commands will also work with `mamba`/`micromamba`.
10-
:::
4+
## Use a virtual environment
115

12-
### Users
13-
To install movement in a new environment, follow one of the options below.
14-
We will use `movement-env` as the environment name, but you can choose any name you prefer.
6+
While not strictly required, it is highly recommended to install `movement` into a
7+
clean virtual environment, using tools such as [conda](conda:) or [uv](uv:).
8+
9+
This should be set up before installing `movement`.
1510

1611
::::{tab-set}
17-
:::{tab-item} Conda
18-
To create an environment with the core package only:
12+
:::{tab-item} conda
13+
Create and activate a new environment:
1914
```sh
20-
conda create -n movement-env -c conda-forge movement
15+
conda create -y -n movement-env -c conda-forge python=3.13
16+
conda activate movement-env
2117
```
2218

23-
If you wish to use the GUI, which additionally requires [napari](napari:),
24-
you should instead run:
19+
We used `movement-env` as the environment name, but you can choose any name you prefer.
20+
:::
21+
22+
:::{tab-item} uv
23+
Make sure [uv is installed on your system](uv:getting-started/installation).
24+
Then create a [virtual environment](uv:pip/environments/) in your project directory:
25+
2526
```sh
26-
conda create -n movement-env -c conda-forge movement napari pyqt
27+
uv init
28+
uv venv --python=3.13
2729
```
28-
You may exchange `pyqt` for `pyside2` if you prefer.
29-
See [napari's installation guide](napari:tutorials/fundamentals/installation.html)
30-
for more information on the backends.
3130

32-
To activate the environment:
33-
```sh
34-
conda activate movement-env
31+
Activate the virtual environment:
32+
```bash
33+
source .venv/bin/activate # On macOS and Linux
34+
```
35+
```powershell
36+
.venv\Scripts\activate # On Windows PowerShell
3537
```
3638
:::
39+
::::
40+
41+
## Install the package
42+
With your environment activated, install `movement` using one of the methods below.
3743

38-
:::{tab-item} Pip
39-
Create and activate an environment with some prerequisites:
44+
::::{tab-set}
45+
:::{tab-item} From conda-forge using conda
46+
To install the core package:
4047
```sh
41-
conda create -n movement-env -c conda-forge python=3.12 pytables
42-
conda activate movement-env
48+
conda install -c conda-forge movement
4349
```
44-
Install the core package from the latest release on PyPI:
50+
51+
If you wish to use the GUI, which requires [napari](napari:), run instead:
52+
```sh
53+
conda install -c conda-forge movement napari pyqt
54+
```
55+
You may exchange `pyqt` for `pyside6` if you prefer a different Qt backend.
56+
See [napari's installation guide](napari:tutorials/fundamentals/installation.html)
57+
for more details on available backends.
58+
59+
:::
60+
61+
:::{tab-item} From PyPI using pip
62+
Install the core package:
4563
```sh
4664
pip install movement
4765
```
48-
If you wish to use the GUI, which additionally requires [napari](napari:),
49-
you should instead run:
66+
If you wish to use the GUI, which requires [napari](napari:), run instead:
5067
```sh
51-
pip install movement[napari] # works on most shells
52-
pip install 'movement[napari]' # works on zsh (default shell on macOS)
68+
pip install "movement[napari]"
5369
```
5470
:::
71+
72+
:::{tab-item} From PyPI using uv
73+
Install the core package:
74+
```sh
75+
uv pip install movement
76+
```
77+
If you wish to use the GUI, which requires [napari](napari:), run instead:
78+
```sh
79+
uv pip install "movement[napari]"
80+
```
81+
:::
82+
5583
::::
5684

5785
:::{dropdown} Note for Apple Silicon users with macOS 13 or earlier
5886
:color: info
5987
:icon: info
6088

61-
We recommend installing `movement` following the `Conda` instructions above, as the `pip` method will likely fail for you.
62-
Alternatively, updating your macOS to version 14 or later will allow `pip` installations to work as expected.
89+
If you are running macOS 13 or earlier on Apple Silicon (M-series) hardware,
90+
we recommend installing `movement` via `conda-forge`,
91+
which provides pre-built Qt libraries compatible with macOS 13.
92+
Alternatively, upgrading to macOS 14 or later enables installation via `pip` or `uv`
93+
without compatibility issues.
94+
6395
:::
6496

65-
### Developers
66-
If you are a developer looking to contribute to movement, please refer to our [contributing guide](target-contributing) for detailed setup instructions and guidelines.
97+
:::{admonition} For developers
98+
:class: tip
99+
100+
If you plan to contribute to `movement`, see the [contributing guide](target-contributing)
101+
for detailed developer setup instructions and coding guidelines.
102+
:::
67103

68-
## Check the installation
69-
To verify that the installation was successful, run (with `movement-env` activated):
104+
## Verify the installation
105+
With your virtual environment activated, run:
70106
```sh
71107
movement info
72108
```
73-
You should see a printout including the version numbers of movement
109+
You should see a printout including the version numbers of `movement`
74110
and some of its dependencies.
75111

76-
To test the GUI installation, you can run:
112+
To test the GUI installation:
77113

78114
```sh
79115
movement launch
@@ -83,37 +119,65 @@ This is equivalent to running `napari -w movement` and should open the `napari`
83119
window with the `movement` widget docked on the right-hand side.
84120

85121
## Update the package
86-
To update `movement` to the latest version, you need to use the same package manager you used to install it (either `conda` or `pip`). If you are not sure which one you used, you can run from your active environment:
122+
123+
Always update using the same package manager you used for installation.
124+
125+
If you are not sure which one you used, you can run `conda list movement` from your active `conda` environment
126+
and check whether the output shows `conda-forge` or `pypi` as the channel.
127+
128+
To update `movement`, run the appropriate command below:
129+
130+
::::{tab-set}
131+
:::{tab-item} conda
87132
```sh
88-
conda list movement
133+
conda update -c conda-forge movement -y
89134
```
90-
If the output shows `conda-forge` as the channel, you used `conda` to install it. If it shows `pypi`, you used `pip`.
135+
:::
91136

92-
Once this is clear, you can update `movement` by running the relevant command from below:
93-
::::{tab-set}
94-
:::{tab-item} Conda
137+
:::{tab-item} pip
95138
```sh
96-
conda update movement -y
139+
pip install -U movement
97140
```
98141
:::
99142

100-
:::{tab-item} Pip
143+
:::{tab-item} uv
101144
```sh
102-
pip install movement -U
145+
uv pip install -U movement
103146
```
104147
:::
105148
::::
106149

107150

108-
If the above fails, try installing it in a fresh new environment instead. This should prevent potential compatibility issues caused by changes in dependency versions. You can first uninstall the existing environment named `movement-env`:
151+
If the above fails, try installing `movement` in a fresh new environment to avoid dependency conflicts.
152+
153+
First remove the existing environment:
154+
155+
::::{tab-set}
156+
:::{tab-item} conda
109157
```sh
110158
conda env remove -n movement-env
111159
```
112-
Once the environment has been removed, you can create a new one following the [installation instructions](#install-the-package) above.
113160

114-
:::{tip}
115-
If you are unsure about the environment name, you can get a list of the environments on your system with:
161+
This command assumes your environment is named `movement-env`.
162+
If you are unsure about the name, you can get a list of the environments
163+
on your system with `conda env list`.
164+
:::
165+
166+
:::{tab-item} uv
167+
Simply delete the `.venv` folder in your project directory.
168+
169+
```bash
170+
rm -rf .venv # On macOS and Linux
171+
```
172+
```powershell
173+
rmdir /s /q .venv # On Windows PowerShell
174+
```
175+
176+
Optionally, you may also clean the `uv` cache for unused packages:
116177
```sh
117-
conda env list
178+
uv cache prune
118179
```
119180
:::
181+
::::
182+
183+
Once the environment has been removed, you can create a new one following the [instructions](#use-a-virtual-environment) above.

0 commit comments

Comments
 (0)