Installation¶
Requirements¶
PyTeCK requires Python 3.10 or newer and the following packages, which are installed automatically with any of the methods below:
Installing a released version¶
The easiest way to install PyTeCK and all of its dependencies is with conda
from the conda-forge and pr-omethe-us channels:
$ conda install -c conda-forge -c pr-omethe-us pyteck
Alternatively, install from PyPI with
pip:
$ pip install pyteck
Note
Cantera and PyTables include compiled extensions. conda ships prebuilt
binaries for every platform, so it is the most reliable option if a pip
install fails to build these dependencies.
Installing from source¶
To install the latest development version, clone the repository and install it
with pip:
$ git clone https://github.com/pr-omethe-us/PyTeCK.git
$ cd PyTeCK
$ pip install .
Use a virtual environment¶
We strongly recommend installing PyTeCK into an isolated virtual environment rather than your system Python. This keeps PyTeCK’s dependencies (including specific versions of Cantera and NumPy) from conflicting with other projects and makes installations reproducible.
Using the standard-library venv:
$ python -m venv .venv
$ source .venv/bin/activate # Windows: .venv\Scripts\activate
$ pip install pyteck
Using conda (recommended when installing the compiled dependencies):
$ conda create -n pyteck python=3.12
$ conda activate pyteck
$ conda install -c conda-forge -c pr-omethe-us pyteck
Deactivate the environment at any time with deactivate (venv) or
conda deactivate (conda).
Developer installation¶
If you want to modify PyTeCK, run its tests, or build this documentation, install it in editable mode inside a virtual environment (see Use a virtual environment) so that changes to the source take effect immediately:
$ git clone https://github.com/pr-omethe-us/PyTeCK.git
$ cd PyTeCK
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install -e .
Optional development tools are declared as dependency groups in
pyproject.toml:
Group |
Contents |
|---|---|
|
|
|
|
|
|
|
everything above |
Install a group with pip (25.1 or newer)…
$ pip install -e . --group all
…or with uv, which installs the default groups automatically:
$ uv sync
Running the tests¶
$ pytest
To measure coverage of the pyteck package:
$ pytest --cov=pyteck
Linting and formatting¶
PyTeCK uses ruff for linting and formatting, wired up through pre-commit:
$ pre-commit install # run the hooks automatically on every commit
$ ruff check . # lint
$ ruff format . # format
Building the documentation¶
$ cd docs
$ make html
The rendered HTML is written to docs/_build/html; open index.html in a
browser to view it.