Python Installation
The installation instructions here are based on the MIALab setup, so you can reuse a similar workflow next semester as well: MIALab documentation
The installation instructions use uv to create a local virtual environment
in .venv and install all dependencies.
Windows
The installation has been tested on Windows 10 and 11.
Install git
Download git and install
Clone CAS-Assignment repository
Open “Windows Terminal” (PowerShell)
cd /path/to/where/you/want/the/codegit clone https://github.com/persmed/cas-assignment.gitcd cas-assignment
Install
uvFollow the official installation instructions: uv documentation
Sync the environment (from the repository root directory)
uv sync
Activate the
casenvironmentRun
.\.venv\Scripts\activate
Note
PowerShell Execution Policy blocks script execution by default on many Windows systems. In that case you may see an error such as:
❯ .\.venv\Scripts\activate .\.venv\Scripts\activate: File path\to\cas-assignment\.venv\Scripts\activate.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https://go.microsoft.com/fwlink/?LinkID=135170.
To allow running local scripts, execute:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedExecute the installation test script to verify the installation
Run
python cas\test_installation.py
Note
The installation test requires the file
data/planning/pelvis_ct.nii.gz. If it is missing,cas/test_installation.pywill stop and print instructions on where to place the file.Download and copy the file by following Assignment Environment Setup.
Linux
The installation has been tested on Ubuntu 16.04 LTS (should also work on newer Ubuntu versions).
git installation
sudo apt-get install git
Clone cas-assignment repository
cd /path/to/where/you/want/the/codegit clone https://github.com/persmed/cas-assignment.gitcd cas-assignment
Install
uvFollow the official installation instructions: uv documentation
Sync the environment (from the repository root directory)
uv sync
Activate the
casenvironmentsource .venv/bin/activate
Execute the installation test script to verify the installation
python cas/test_installation.py
Note
The installation test requires the file
data/planning/pelvis_ct.nii.gz. If it is missing,cas/test_installation.pywill stop and print instructions on where to place the file.Download and copy the file by following Assignment Environment Setup.
macOS
The installation has been tested on macOS 10.13.6 (should also work on newer macOS versions).
git installation
Download git and install
Clone cas-assignment repository
cd /path/to/where/you/want/the/codegit clone https://github.com/persmed/cas-assignment.gitcd cas-assignment
Install
uvFollow the official installation instructions: uv documentation
Sync the environment (from the repository root directory)
uv sync
Activate the
casenvironmentsource .venv/bin/activate
Execute the installation test script to verify the installation
python cas/test_installation.py
Note
The installation test requires the file
data/planning/pelvis_ct.nii.gz. If it is missing,cas/test_installation.pywill stop and print instructions on where to place the file.Download and copy the file by following Assignment Environment Setup.
Conda Installation (Deprecated)
Deprecated since version 2026-03: The conda-based installation is deprecated. Use the uv-based installation above.
Windows
The installation has been tested on Windows 10 and 11.
Install git
Download git and install
Clone CAS-Assignment repository
Open “Windows Terminal” (PowerShell)
cd /path/to/where/you/want/the/codegit clone https://github.com/persmed/cas-assignment.gitcd cas-assignment
Miniconda installation (official website)
Launch the Miniconda installer
Select an install for “Just Me” unless you’re installing for all users (which requires Windows administrator privileges)
Choose whether to add Miniconda to your PATH environment variable. We recommend not adding it to PATH, since this can interfere with other software.
Choose whether to register Miniconda as your default Python. Unless you plan on installing and running multiple Python distributions, you should accept the default and leave this box checked.
Verify the installation
Open “Miniconda Prompt”
conda list, which should list installed conda packages
Create a new Python environment with all dependencies
conda env create --file environment.yml
(Optional) If you are using PowerShell instead of the command prompt run
conda init powershell
Activate the environment by
conda activate cas
Note
If
conda activatedoes not work, runconda initonce, then close and reopen the terminal.Execute the installation test script to verify the installation
python cas/test_installation.py
Note
The installation test requires the file
data/planning/pelvis_ct.nii.gz. If it is missing,cas/test_installation.pywill stop and print instructions on where to place the file.Download and copy the file by following Assignment Environment Setup.
Linux
The installation has been tested on Ubuntu 16.04 LTS (should also work on newer Ubuntu versions).
git installation
sudo apt-get install git
Clone cas-assignment repository
cd /path/to/where/you/want/the/codegit clone https://github.com/persmed/cas-assignment.gitcd cas-assignment
Run Miniconda installation script (official website)
Download the Miniconda installer for your architecture, then run for example:
bash <path_to_file>/Miniconda3-latest-Linux-x86_64.shScroll to the bottom of the license and enter
yesto agree the licenseAccept suggested installation path (or change it if you know what you do)
yesto initialize Miniconda (adds conda to your shell)Reopen the terminal
Verify the installation
conda list, which should list installed conda packages
Create a new Python environment with all dependencies
conda env create --file environment.yml
Activate the environment
conda activate cas
Note
If
conda activatedoes not work, runconda initonce, then close and reopen the terminal.Execute the installation test script to verify the installation
python cas/test_installation.py
Note
The installation test requires the file
data/planning/pelvis_ct.nii.gz. If it is missing,cas/test_installation.pywill stop and print instructions on where to place the file.Download and copy the file by following Assignment Environment Setup.
macOS
The installation has been tested on macOS 10.13.6 (should also work on newer macOS versions).
git installation
Download git and install
Clone cas-assignment repository
cd /path/to/where/you/want/the/codegit clone https://github.com/persmed/cas-assignment.gitcd cas-assignment
Miniconda installation (official website)
Download and run the Miniconda installer for macOS (Intel or Apple Silicon, depending on your machine)
Follow the installer steps
Reopen the terminal
Verify the installation
conda list, which should list installed conda packages
Create a new Python environment with all dependencies
conda env create --file environment.yml
Activate the environment
conda activate cas
Note
If
conda activatedoes not work, runconda initonce, then close and reopen the terminal.Execute the installation test script to verify the installation
python cas/test_installation.py
Note
The installation test requires the file
data/planning/pelvis_ct.nii.gz. If it is missing,cas/test_installation.pywill stop and print instructions on where to place the file.Download and copy the file by following Assignment Environment Setup.