Installation¶
This guide provides different ways to install spMetaTME, whether you are using it as a library in your Python scripts or as a standalone CLI tool.
Prerequisites¶
Before installing spMetaTME, ensure your system meets these requirements:
Python¶
Version: Python 3.9 or higher (3.10+ recommended).
Package Manager:
piporuv(recommended for faster dependency resolution).
Additional Tools (Recommended)¶
R Statistics: Required for spatial domain clustering (specifically used by the
BayesSpacepackage).NVIDIA GPU: Highly recommended for faster model inference and training (requires
CUDAand compatible drivers).
Standard Installation¶
Using uv (Recommended)¶
If you are using the modern uv package manager:
uv add spmetatme
Using pip¶
To install spMetaTME directly from PyPI:
pip install spmetatme
Installing from Source¶
If you want to contribute to the package or use the latest developmental version, you can install it from GitHub.
Clone the repository:
git clone https://github.com/SurajRepo/spmetatme.git cd spmetatme
Install in editable mode:
pip install -e .
Verifying Installation¶
Once installed, you can verify that the CLI is working by checking the version:
spmetatme --version
Or by listing the available metabolic models for inference:
spmetatme infer --list-models
Troubleshooting¶
R Dependency Issues¶
If spatial clustering fails, ensure R is correctly installed and accessible in your system’s PATH. You can verify this by typing R --version in your terminal.
GPU Support¶
spMetaTME uses PyTorch. If you have an NVIDIA GPU but it’s not being utilized, check your PyTorch installation:
import torch
print(torch.cuda.is_available())
If this returns False, you may need to install the version of torch that matches your CUDA version. See pytorch.org for instructions.