POT
Python Optimal Transport Library
What it is and what it does
POT is a Python library for solving optimal transport problems—a mathematical framework for measuring and computing distances between distributions. It provides a large collection of differentiable solvers covering exact linear OT, entropic and quadratic regularized variants, Gromov-Wasserstein distances, unbalanced and partial OT, and specialized algorithms for 1D, circular, and Gaussian mixture model transport. The library also includes machine learning applications such as domain adaptation, transport mapping, and subspace learning.
The package depends on numpy and scipy for numerical computation and offers multiple backend support (PyTorch, JAX, TensorFlow, CuPy) to work with different array types. It is actively maintained, production-stable, and widely used in research and applied settings where distribution comparison, alignment, or interpolation is needed.
Use it for:
- Compute Wasserstein distances and optimal transport plans between point clouds or distributions for metric learning.
- Perform domain adaptation by aligning source and target distributions in machine learning pipelines.
- Calculate Gromov-Wasserstein distances to compare structured data like graphs or point clouds with different geometries.
- Compute Wasserstein barycenters to find representative distributions or aggregate multiple datasets.
- Solve unbalanced or partial optimal transport problems when mass conservation is relaxed.
- Integrate OT solvers into neural networks via differentiable layers for end-to-end learning.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
POT provides solvers for optimal transport problems, including Wasserstein distances, Gromov-Wasserstein distances, and related algorithms for signal processing, image processing, and machine learning applications.
Yes. POT is actively maintained, production-stable (Development Status 5), has no known vulnerabilities, and offers a comprehensive suite of optimal transport algorithms backed by research. The medium install friction is manageable with prebuilt wheels. Install if you need optimal transport solvers for machine learning, domain adaptation, or distribution comparison; skip if you have no use for these mathematical tools.
Install
pot on PyPI
pip
pip install potuv
uv add potpoetry
poetry add potInstalling POT
Before you install
Medium install friction due to compiled components (C, C++, Cython). Prebuilt wheels available for Python 3.10–3.13 on macOS, Linux, and Windows. Active maintenance with recent release (16 days old) and 2837 GitHub stars.
License in practice
MIT license (permissive) allows commercial and private use with minimal restrictions—include a copy of the license and copyright notice.
Quickstart
import pot
import numpy as np
# Compute Wasserstein distance between two distributions
a = np.array([0.5, 0.5])
b = np.array([0.3, 0.7])
M = np.array([[0, 1], [1, 0]]) # cost matrix
wasserstein_dist = pot.emd(a, b, M)
Requires numpy and scipy. Compiled wheels available for Python 3.7–3.13; source build requires C/C++ compiler and Cython.
Verify before relying
- Whether all advertised solvers (e.g., Graph Neural Network layers, all backend integrations) are production-ready or still experimental.
- Performance characteristics and scalability limits for large-scale problems mentioned in the description.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — numpy, scipy |
| Maintenance | actively maintained — 16 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 587,786/month — #5,872 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pot-0.9.7.post1-cp310-cp310-macosx_10_9_universal2.whl; pot-0.9.7.post1-cp310-cp310-macosx_10_9_x86_64.whl; pot-0.9.7.post1-cp310-cp310-macosx_11_0_arm64.whl; pot-0.9.7.post1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; pot-0.9.7.post1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pot-0.9.7.post1-cp310-cp310-win_amd64.whl; pot-0.9.7.post1-cp311-cp311-macosx_10_9_universal2.whl; pot-0.9.7.post1-cp311-cp311-macosx_10_9_x86_64.whl; pot-0.9.7.post1-cp311-cp311-macosx_11_0_arm64.whl; pot-0.9.7.post1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; pot-0.9.7.post1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pot-0.9.7.post1-cp311-cp311-win_amd64.whl; pot-0.9.7.post1-cp312-cp312-macosx_10_13_universal2.whl; pot-0.9.7.post1-cp312-cp312-macosx_10_13_x86_64.whl; pot-0.9.7.post1-cp312-cp312-macosx_11_0_arm64.whl; pot-0.9.7.post1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; pot-0.9.7.post1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pot-0.9.7.post1-cp312-cp312-win_amd64.whl; pot-0.9.7.post1-cp313-cp313-macosx_10_13_universal2.whl; pot-0.9.7.post1-cp313-cp313-macosx_10_13_x86_64.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
ott-jaxOTT-JAX solves optimal transport…
permissive · top 15,000 on PyPI
geomlossComputes geometric loss functions for comparing…
permissive · top 15,000 on PyPI
ortoolsOR-Tools provides constraint programming,…
permissive · top 5,000 on PyPI
ropwrRoPWR computes optimal piecewise polynomial…
permissive · top 15,000 on PyPI
pyamgPyAMG provides Algebraic Multigrid (AMG)…
permissive · top 15,000 on PyPI
pyrootsImplements root-finding algorithms (bisect,…
permissive · top 15,000 on PyPI
torchdiffeqProvides PyTorch-based ODE solvers with…
permissive · top 5,000 on PyPI
MosekMOSEK solves large-scale convex and…
unclear · top 15,000 on PyPI
quadprogSolves strictly convex quadratic programming…
copyleft · top 15,000 on PyPI
munkresImplements the Munkres algorithm (Hungarian…
permissive · top 15,000 on PyPI