Skip to content

Installation

PtyLab.py requires Python 3.10–3.13 and is distributed on PyPI.

From PyPI (pip)

pip install ptylab
pip install "ptylab[gpu]"

Tip

For faster installs, use uv:

uv pip install ptylab

Latest development version

To install the unreleased state of main directly from GitHub:

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.