skillfed

POT

Python Optimal Transport Library

pot v0.9.7.post1 587.8K downloads/30d#5,872 on PyPI2,837
Permissive license MIT Active released

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 pot

uv

uv add pot

poetry

poetry add pot

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: CProgramming Language :: C++Programming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: MathematicsTopic :: Utilities

Tags

optimal transport solverwasserstein distancegromov-wassersteindomain adaptationtransport mappingbarycenter computationentropic regularization OT
optimal-transportdomain-adaptationcomputational-geometry

More Utilities packages

Further reading