Installation¶
tform uses uv as its package and environment manager. uv is a fast, modern Python tool that replaces pip, venv, and pyenv in a single command.
Step 1 — Install uv¶
Choose the command for your operating system.
Verify installation:
You should see something like uv 0.5.x. If the command is not found, check that ~/.cargo/bin (the default install path) is on your PATH.
Full documentation: docs.astral.sh/uv/getting-started/installation
Step 2 — Clone the repository¶
Step 3 — Install dependencies¶
This creates a .venv/ directory in the project root and installs all dependencies for both the terraforming physics package and the tform CLI. You do not need to create a virtual environment manually.
Step 4 — Verify tform works¶
Using uv run is the recommended way to call tform — it automatically uses the project's virtual environment without you needing to activate it.
Activating the virtual environment (optional)¶
If you prefer to activate the environment so you can run tform directly without uv run:
To deactivate:
Troubleshooting¶
tform: command not found¶
The most common cause is that the virtual environment is not active and you are not using uv run. Fix with either:
# Option A: always prefix with uv run
uv run tform man mars
# Option B: activate the venv first, then use tform directly
source .venv/bin/activate
tform man mars
uv: command not found after installation¶
The uv installer adds itself to ~/.local/bin (Linux) or ~/.cargo/bin (macOS). Make sure that directory is on your PATH:
On Windows, restart your terminal after installation — the installer updates the system PATH automatically.
uv sync fails with Python version error¶
tform requires Python 3.12 or later. uv can install the right Python version automatically:
.venv exists but tform still not found¶
The venv may be stale. Remove it and resync:
ModuleNotFoundError: No module named 'torch'¶
PyTorch was not installed correctly. Run:
If you need a CUDA-enabled build of PyTorch, install it manually after sync:
GPU support (optional)¶
The simulator uses PyTorch for all tensor operations. If a CUDA GPU is available, pass device="cuda" when constructing objects directly in Python:
from src.celestials import Mars
from src.engine import TimeController, Accuracy
planet = Mars(device="cuda")
tc = TimeController(planet, accuracy=Accuracy.ACCURATE)
The CLI always runs on CPU; GPU acceleration is only available through the Python API.