Skip to content

Installation

PtyLab.py requires Python 3.10–3.13 and is distributed via GitHub.

From GitHub (pip)

pip install git+https://github.com/PtyLab/PtyLab.py.git
pip install "ptylab[gpu] @ git+https://github.com/PtyLab/PtyLab.py.git"

Tip

For faster installs, use uv:

uv pip install git+https://github.com/PtyLab/PtyLab.py.git

Verify GPU detection

After installing with a CUDA extra, confirm the GPU is detected:

ptylab check gpu

This prints available GPU device information or warns if no GPU is found.

Development setup

Clone the repository and install with development dependencies:

git clone https://github.com/PtyLab/PtyLab.py.git
cd PtyLab.py
uv sync --extra dev

This creates a .venv virtual environment in the project root. Select it in your IDE or activate it:

source .venv/bin/activate

For GPU support during development:

uv sync --extra dev,gpu

Running tests

uv run pytest tests

Serving documentation locally

uv sync --extra docs
uv run mkdocs serve

Then open http://127.0.0.1:8000 in your browser.