How to install Py-Feat#
Py-Feat requires Python 3.11+ (3.11, 3.12, and 3.13 are tested).
Basic setup#
We recommend uv — a fast, modern Python package manager. Create an environment and install the latest stable release from PyPI:
uv venv --python 3.13 # creates .venv on Python 3.13 (3.11+ supported)
uv pip install py-feat
Then either activate the environment (source .venv/bin/activate) or run
commands through it with uv run, e.g. uv run python my_script.py.
To get the latest development version instead, install directly from GitHub:
uv pip install "git+https://github.com/cosanlab/py-feat.git"
Note
Prefer plain pip? Every command above works by dropping uv:
pip install py-feat or pip install "git+https://github.com/cosanlab/py-feat.git".
Note
Py-Feat supports CPU and NVIDIA (CUDA) GPUs, and — since v0.7 — Apple Silicon
GPUs via Metal (MPS). Pass device='auto' (or device='mps' / device='cuda')
when constructing a Detector to use the GPU; the default is cpu.
Using Google Colab#
On any page in these docs you can click the
badge to open it in Google Colab.
Note
Add and run !pip install py-feat as the first cell of the Colab notebook
before running any other code.
Development setup#
To contribute to py-feat, install an editable copy so your source changes are picked up immediately:
git clone https://github.com/cosanlab/py-feat.git
cd py-feat
uv venv
uv pip install -e .
uv pip install -r requirements-dev.txt
Run the test suite with uv run pytest (use -m "not network" to skip tests
that download models from the HuggingFace Hub).