Installing CAREamics with uv#
Follow uv installation guidelines to use uv.
Important
Please refer to the installing PyTorch section of uv documentation should you encounter issues running on GPU. In particular it may be necessary to install torch independently in the venv on Windows (see this section)
Using notebooks#
To run notebooks, install juv:
Running CAREamics examples#
CAREamics-examples contains multiple notebook examples that can be directly run with uv:
Running your own notebook#
To run your own notebook, we recommend adding PEP723 metadata:
You can also pin the CAREamics dependency in order to improve reproducibility:
CAREamics as a dependency#
In this section, we will describe creating a project with CAREamics as a dependency, using standard uv:
- Pin the dependency for reproducibility
Installing CAREamics with GPU on Windows#
This section walks you through creating a CAREamics-based projects using GPU on Windows.
-
Create a
pyproject.tomlin your project folder:pyproject.toml[project] name = "myproject" version = "0.1.0" description = "Running CAREamics on Windows with GPU" readme = "README.md" requires-python = ">=3.11" dependencies = [ "torch>=2.0,<=2.9.0", # (1)! "torchvision<=0.24.0", "careamics[examples]>=0.0.18", ] [tool.uv.sources] torch = [ { index = "pytorch" }, ] torchvision = [ { index = "pytorch" }, ] [[tool.uv.index]] name = "pytorch" url = "https://download.pytorch.org/whl/cu128" # (2)! explicit = true- The constraints here will change with time, and are given as indications here.
- This will depend on your system (especially GPU driver), check the PyTorch instructions.
-
Test GPU accessibility by running the following script:
- Add your training script or notebook to the project and run it with
uv(see previous sections).