Environment and prerequisites
Choose the environment that will execute your workflow. The Python library and the CLI share model APIs, but their installed packages need not be the same.
| Workflow | Environment to prepare | Next step |
|---|---|---|
| Python scripts or notebooks | An isolated Python 3.11–3.13 environment. | Install the library. |
r2x pipelines | The runtime managed by r2x-cli. | Install the CLI plugin. |
Python scripts and notebooks
Section titled “Python scripts and notebooks”Confirm that the interpreter you intend to use is supported:
python --versionIf this reports an unsupported version, select an installed Python 3.11, 3.12, or 3.13 interpreter before creating the environment. Create a virtual environment in your project directory:
python -m venv .venvActivate it on macOS/Linux:
source .venv/bin/activateOr activate it in Windows PowerShell:
.venv\Scripts\Activate.ps1Confirm where Python is running before installing packages:
python -c "import sys; print(sys.executable)"The path should point inside this .venv. For notebooks, select the corresponding
kernel so imports and package installation use the same interpreter.
CLI pipelines
Section titled “CLI pipelines”Install uv and the r2x-cli binary. Confirm the executable is available:
r2x --versionPrepare the Python runtime required by that CLI binary:
r2x python installInspect its actual version and environment path:
r2x python showThe CLI binary’s Python ABI must match its managed runtime. The tutorials were executed with CLI 0.1.15 and its Python 3.12 runtime. Changing a project virtual environment does not change the binary’s ABI; see CLI runtime guidance if startup reports an ABI mismatch.
Data prerequisites
Section titled “Data prerequisites”You do not need study data to verify installation.
The tutorial downloads pinned public fixture data
using curl and explains its companion files. It needs network access and a new
working directory. XML parsing does not need a licensed PLEXOS solver; running an optimization is a separate workflow.