# 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**: `pip` or `uv` (recommended for faster dependency resolution). ### Additional Tools (Recommended) * **R Statistics**: Required for spatial domain clustering (specifically used by the `BayesSpace` package). * **NVIDIA GPU**: Highly recommended for faster model inference and training (requires `CUDA` and compatible drivers). --- ## Standard Installation ### Using `uv` (Recommended) If you are using the modern `uv` package manager: ```bash uv add spmetatme ``` ### Using `pip` To install `spMetaTME` directly from PyPI: ```bash 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. 1. **Clone the repository**: ```bash git clone https://github.com/SurajRepo/spmetatme.git cd spmetatme ``` 2. **Install in editable mode**: ```bash pip install -e . ``` --- ## Verifying Installation Once installed, you can verify that the CLI is working by checking the version: ```bash spmetatme --version ``` Or by listing the available metabolic models for inference: ```bash 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: ```python 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](https://pytorch.org/) for instructions.