mpi4py
Python bindings for MPI
Decision gist · record as of 2026-08-14
Yes, if you need distributed parallel computing in Python and have (or can install) an MPI runtime. mpi4py is mature, actively maintained, widely used in scientific computing, and carries no security vulnerabilities. Install friction is moderate—you must have an MPI implementation available—but wheels and clear documentation make setup straightforward on Linux, macOS, and Windows. Not necessary for single-machine parallelism (use multiprocessing or threading instead).AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- An MPI implementation (MPICH, Open MPI, Intel MPI, or Microsoft MPI) must be installed and discoverable on your system; on Linux you may need to set LD_LIBRARY_PATH to locate the MPI shared library.
- Medium install friction due to compiled C bindings requiring an MPI runtime (MPICH, Open MPI, Intel MPI, or Microsoft MPI) to be present on the system.
- Wheels are available for multiple platforms and Python versions, but successful installation depends on having a compatible MPI implementation already installed or available via package manager.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is a permissive license allowing commercial and private use with minimal restrictions, requiring only that the license text and copyright notice be included in distributions.
last release 2026-05-16 (90 days) · last repo commit 2026-08-14 · 920 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 913,486 downloads/mo, #4,739 on PyPI
Alternatives
Verify before relying
import mpi4py
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
print(f'Rank {rank} of {size}')- Whether GPU-aware MPI features (CUDA/ROCm) are supported in the standard wheels or require custom builds
- Performance characteristics and scalability limits for typical workloads
- Compatibility matrix between specific MPI implementation versions and mpi4py releases
What it is and what it does
mpi4py is a mature Python interface to the MPI standard, allowing you to write distributed parallel programs that coordinate work across multiple processes and machines. It exposes MPI-2 C++ bindings through a Pythonic API, supporting both point-to-point communication (send/receive) and collective operations (broadcast, scatter, gather, reductions). The package handles any picklable Python object for general communication and offers optimized fast paths for objects that expose the Python buffer interface, such as NumPy arrays.
Beyond basic messaging, mpi4py provides process groups and topologies, parallel I/O, dynamic process management (spawn, accept/connect), and one-sided remote memory access operations. Installation is straightforward via pip when an MPI runtime is available; wheels support Linux, macOS, and Windows across multiple architectures and MPI implementations. The package is actively maintained, supports current Python versions (3.8 through 3.14), and has no known security vulnerabilities.
Use it for
- Distribute NumPy array computations across a cluster using collective operations for efficient data movement.
- Implement parallel Monte Carlo simulations where independent processes run separate trials and gather results.
- Coordinate long-running scientific workflows across HPC nodes with dynamic process spawning and name publishing.
- Build fault-tolerant data processing pipelines using MPI's one-sided operations and passive target synchronization.
- Parallelize embarrassingly parallel workloads (parameter sweeps, batch processing) across a supercomputer.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need distributed parallel computing in Python and have (or can install) an MPI runtime.
mpi4py is mature, actively maintained, widely used in scientific computing, and carries no security vulnerabilities. Install friction is moderate—you must have an MPI implementation available—but wheels and clear documentation make setup straightforward on Linux, macOS, and Windows. Not necessary for single-machine parallelism (use multiprocessing or threading instead).
Install
mpi4py on PyPI
Before you install
Medium install friction due to compiled C bindings requiring an MPI runtime (MPICH, Open MPI, Intel MPI, or Microsoft MPI) to be present on the system. Wheels are available for multiple platforms and Python versions, but successful installation depends on having a compatible MPI implementation already installed or available via package manager.
An MPI implementation (MPICH, Open MPI, Intel MPI, or Microsoft MPI) must be installed and discoverable on your system; on Linux you may need to set LD_LIBRARY_PATH to locate the MPI shared library.
License in practice
BSD-3-Clause is a permissive license allowing commercial and private use with minimal restrictions, requiring only that the license text and copyright notice be included in distributions.
Quickstart
import mpi4py
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
print(f'Rank {rank} of {size}')
Verify before relying
- Whether GPU-aware MPI features (CUDA/ROCm) are supported in the standard wheels or require custom builds
- Performance characteristics and scalability limits for typical workloads
- Compatibility matrix between specific MPI implementation versions and mpi4py releases
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 90 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 913,486 / month, #4,739 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 6 - MatureEnvironment :: GPUEnvironment :: GPU :: NVIDIA CUDAIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: POSIX :: BSDOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: CProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Scientific/EngineeringTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Distributed ComputingTyping :: Typed |
Evidence: mpi4py-4.1.2-cp310-abi3-macosx_10_9_x86_64.whl; mpi4py-4.1.2-cp310-abi3-macosx_11_0_arm64.whl; mpi4py-4.1.2-cp310-abi3-manylinux1_x86_64.manylinux_2_5_x86_64.whl; mpi4py-4.1.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; mpi4py-4.1.2-cp310-abi3-win_amd64.whl; mpi4py-4.1.2-cp310-cp310-macosx_10_9_x86_64.whl; mpi4py-4.1.2-cp310-cp310-macosx_11_0_arm64.whl; mpi4py-4.1.2-cp310-cp310-manylinux1_x86_64.manylinux_2_5_x86_64.whl; mpi4py-4.1.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; mpi4py-4.1.2-cp310-cp310-win_amd64.whl; mpi4py-4.1.2-cp311-cp311-macosx_10_9_x86_64.whl; mpi4py-4.1.2-cp311-cp311-macosx_11_0_arm64.whl; mpi4py-4.1.2-cp311-cp311-manylinux1_x86_64.manylinux_2_5_x86_64.whl; mpi4py-4.1.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; mpi4py-4.1.2-cp311-cp311-win_amd64.whl; mpi4py-4.1.2-cp312-cp312-macosx_10_13_x86_64.whl; mpi4py-4.1.2-cp312-cp312-macosx_11_0_arm64.whl; mpi4py-4.1.2-cp312-cp312-manylinux1_x86_64.manylinux_2_5_x86_64.whl; mpi4py-4.1.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; mpi4py-4.1.2-cp312-cp312-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “MPI Python bindings”
- mpi4pympi4py provides Python bindings for the Message Passing Interface…
- lammpslammps provides pre-built Python bindings to the LAMMPS molecular…
- eckitlibeckitlib is a Python binding for EcKit, a cross-platform C++ toolkit…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also impi-rt · openmpi · mpich · pytest-mpi · debug-mgr · nccl4py · rpy2-rinterface · intel-openmp · carolina · rpy2