Files
presidio/docs/installation.md
Copilot b12ca19b13 feat: add Python 3.14 compatibility to all remaining Presidio packages (#2147)
* Initial plan

* feat: add Python 3.14 compatibility to all remaining Presidio packages

- Update requires-python to <3.15 in anonymizer, image-redactor, cli,
  structured, and umbrella packages
- Add Python 3.14 PyPI classifier to all affected packages
- Split spacy dependency markers in image-redactor to exclude 3.8.14
  on Python 3.14 (no compatible wheel), matching analyzer pattern
- Extend CI matrix to test all components on Python 3.14
- Document Python 3.14 as a supported version in installation docs
- Add CHANGELOG entry under [unreleased]

Closes #2096

* ci: move Python 3.14 into main python-version matrix

All packages now support 3.14, so add it directly to the matrix array
instead of duplicating each component in `include` entries.

* build: regenerate uv.lock files to match updated requires-python bounds

* fix: merge duplicate Changed headings in CHANGELOG.md Unreleased section

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Sharon Hart <sharonh.dev@gmail.com>
2026-07-13 11:01:42 +03:00

5.6 KiB

Installing Presidio

Description

This document describes the installation of the entire Presidio suite using pip (as Python packages) or using Docker (As containerized services).

Using pip

!!! note "Note"

Consider installing the Presidio python packages
in a virtual environment like [venv](https://docs.python.org/3/tutorial/venv.html)
or [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).

Supported Python Versions

Presidio is supported for the following python versions:

  • 3.10
  • 3.11
  • 3.12
  • 3.13
  • 3.14

PII anonymization on text

For PII anonymization on text, install the presidio-analyzer and presidio-anonymizer packages with at least one NLP engine (spaCy, transformers or stanza):

===+ "spaCy (default)"

```
pip install presidio_analyzer
pip install presidio_anonymizer
python -m spacy download en_core_web_lg
```

=== "Transformers"

```
pip install "presidio_analyzer[transformers]"
pip install presidio_anonymizer
python -m spacy download en_core_web_sm
```

!!! note "Note"
    
    When using a transformers NLP engine, Presidio would still use spaCy for other capabilities,
    therefore a small spaCy model (such as en_core_web_sm) is required. 
    Transformers models would be loaded lazily. To pre-load them, see: [Downloading a pre-trained model](./analyzer/nlp_engines/transformers.md#downloading-a-pre-trained-model)

=== "Stanza"

```
pip install "presidio_analyzer[stanza]"
pip install presidio_anonymizer
```


!!! note "Note"
    
    Stanza models would be loaded lazily. To pre-load them, see: [Downloading a pre-trained model](./analyzer/nlp_engines/spacy_stanza.md#download-the-pre-trained-model).

GPU acceleration (optional)

For GPU acceleration, install the appropriate dependencies for your hardware:

  • Linux with NVIDIA GPU: pip install "spacy[cuda12x]" (or the version matching your CUDA installation)
  • macOS with Apple Silicon: MPS is detected automatically, no additional dependencies required.

For detailed GPU setup, verification, and troubleshooting, see GPU Acceleration.

PII redaction in images

For PII redaction in images

  1. Install the presidio-image-redactor package:

    pip install presidio_image_redactor
    
    # Presidio image redactor uses the presidio-analyzer
    # which requires a spaCy language model:
    python -m spacy download en_core_web_lg
    
  2. Install an OCR engine. The default version uses the Tesseract OCR Engine. More information on installation can be found here.

Using Docker

Presidio can expose REST endpoints for each service using Flask and Docker. To download the Presidio Docker containers, run the following command:

!!! note "Note"

This requires Docker to be installed. [Download Docker](https://docs.docker.com/get-docker/).

!!! important "Container registry moved to GitHub Packages"

New Presidio container releases are published to [GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) under the [Data Privacy Stack packages organization](https://github.com/orgs/data-privacy-stack/packages). The legacy Microsoft Container Registry images at `mcr.microsoft.com/presidio-*` are no longer updated. If you previously used `mcr.microsoft.com/presidio-analyzer:latest`, switch to `ghcr.io/data-privacy-stack/presidio-analyzer:latest`; for production, prefer pinning an explicit release tag from the package page.

For PII anonymization in text

For PII detection and anonymization in text, the presidio-analyzer and presidio-anonymizer modules are required.

# Download Docker images
docker pull ghcr.io/data-privacy-stack/presidio-analyzer
docker pull ghcr.io/data-privacy-stack/presidio-anonymizer

# Run containers with default ports
docker run -d -p 5002:3000 ghcr.io/data-privacy-stack/presidio-analyzer:latest

docker run -d -p 5001:3000 ghcr.io/data-privacy-stack/presidio-anonymizer:latest

For PII redaction in images

For PII detection in images, the presidio-image-redactor is required.

# Download Docker image
docker pull ghcr.io/data-privacy-stack/presidio-image-redactor

# Run container with the default port
docker run -d -p 5003:3000 ghcr.io/data-privacy-stack/presidio-image-redactor:latest

Once the services are running, their APIs are available. API reference and example calls can be found here.

Install from source

To install Presidio from source, first clone the repo:

  • using HTTPS
git clone https://github.com/data-privacy-stack/presidio.git
  • Using SSH
git clone git@github.com:data-privacy-stack/presidio.git

Then, build the containers locally.

!!! note "Note" Presidio uses docker-compose to manage the different Presidio containers.

From the root folder of the repo:

docker-compose up --build

Alternatively, you can build and run individual services. For example, for the presidio-anonymizer service:

docker build ./presidio-anonymizer -t presidio/presidio-anonymizer

And run:

docker run -d -p 5001:5001 presidio/presidio-anonymizer

For more information on developing locally, refer to the setting up a development environment section.