Conda
Conda, mamba, or micromamba can be used to create the project environment.
Conda is a Python environment manager that is useful for creating and maintaining Python packages and their dependencies. It is available either as part of the larger Anaconda framework, or separately as part of Miniconda. Although not required, it is helpful for setting up an environment for the Python ISMRMD client/server. Mamba and micromamba are drop-in replacements for Conda that are often faster at resolving dependencies. The following instructions are for micromamba, but micromamba can be replaced with conda if preferred.
The dependency files are environment.yml and environment_windows.yml.
Basic setup
git clone https://github.com/kspaceKelvin/python-ismrmrd-server.git
cd python-ismrmrd-server
micromamba create -f environment.yml
micromamba activate mrd
On Windows, use environment_windows.yml.
Notes
- On Windows, install
ismrmrdwith pip if it is not present:
pip install ismrmrd
- Optional simulation helper package:
uv pip install git+https://github.com/ismrmrd/ismrmrd-python-tools.git
The ismrmrd-python-tools repository contains useful simulation libraries, including the code used by generate_cartesian_shepp_logan_dataset.py. Install it by cloning the repository and running pip install . with the trailing dot:
git clone https://github.com/ismrmrd/ismrmrd-python-tools.git
cd ismrmrd-python-tools
pip3 install .
Full setup
Install Git and micromamba, Miniconda, or another Conda-compatible tool.
On Windows, open PowerShell. Clone the repository and create the environment:
git clone https://github.com/kspaceKelvin/python-ismrmrd-server.git
cd python-ismrmrd-server
micromamba create -f environment_windows.yml
micromamba activate mrd
For Linux and macOS, use environment.yml instead. To use the environment later, run micromamba activate mrd.
If conda.anaconda.org is blocked, replace the conda-forge channel in environment_windows.yml with https://prefix.dev/conda-forge. The repository does not use Anaconda's defaults channel.
Anaconda changed its terms of service in 2024. Miniconda, Miniforge, and micromamba remain free to use; the conda-forge channel remains open source.
Conda download errors
If micromamba reports an error such as:
critical libmamba Multiple errors occurred:
Download error (23) Failed writing received data to disk/application
Subdir conda-forge/noarch not loaded!
The anaconda.org domain may be blocked. Verify this by opening anaconda.org/conda-forge in a browser. A conda-forge mirror is hosted by prefix.dev; use https://prefix.dev/conda-forge as the channel in environment_windows.yml if necessary.