delocate
Move macOS dynamic libraries into package
What it is and what it does
Delocate is a macOS-specific build tool that solves the problem of distributing Python wheels containing compiled extensions that link to dynamic libraries outside the system paths. When you build a wheel on a machine with Homebrew or custom-compiled libraries, the wheel's extensions link to those libraries by absolute path—making the wheel fail on other machines that don't have them installed. Delocate analyzes the wheel, copies all non-system dynamic libraries into a `.dylibs` directory within the wheel, and rewrites the extension load paths to find them there instead.
The package provides four command-line tools: `delocate-listdeps` shows what libraries a wheel depends on, `delocate-path` relocates libraries in a directory tree, `delocate-wheel` processes a wheel file directly, and `delocate-merge` combines wheels built for different architectures (e.g., `x86_64` and `arm64`) into a single universal binary. It also validates that wheels contain the required architectures for compatibility with system Python and Python.org distributions.
Use it for:
- Build and distribute a Scipy or NumPy wheel from a machine with Homebrew gfortran without requiring users to install gfortran.
- Verify that a wheel's compiled extensions and libraries have the correct architectures (x86_64, arm64) before release.
- Combine separately built x86_64 and arm64 wheels into a single universal2 wheel for macOS.
- Audit which external dynamic libraries a third-party wheel depends on before installation.
- Prepare wheels for PyPI distribution that will work on any macOS machine with Python 3.9+.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Delocate finds and relocates dynamic libraries that macOS Python extensions depend on, bundling them into wheels and rewriting load paths so wheels work on machines without those libraries installed.
Yes, if you build or distribute Python wheels on macOS with compiled extensions. Delocate is the standard tool for making those wheels portable across machines. If you only install wheels or work on Linux, it is not needed. No known security vulnerabilities; actively maintained; low install friction.
Install
delocate on PyPI
pip
pip install delocateuv
uv add delocatepoetry
poetry add delocateInstalling delocate
Before you install
Low friction: pure Python wheel with three lightweight runtime dependencies (packaging, typing_extensions, macholib). Active maintenance with last commit 2026-05-25 and stable release status.
License in practice
BSD 2-Clause permissive license; you can use, modify, and distribute delocate and wheels it processes freely, provided you retain the copyright notice and disclaimer.
Quickstart
pip install delocate
# List dynamic libraries a wheel depends on
delocate-listdeps scipy-0.14.0-cp34-cp34m-macosx_10_6_intel.whl
# Copy libraries into wheel and relink
delocate-wheel -w fixed_wheels scipy-0.14.0-cp34-cp34m-macosx_10_6_intel.whl
macOS only; requires Python 3.9 or later; wheels must contain compiled extensions with dynamic library dependencies to be useful.
Verify before relying
- Whether delocate-merge (dual-architecture wheel combining) works with current macOS/Xcode toolchains.
- Performance impact of delocate-wheel on large wheels with many library dependencies.
Package facts
| License | Copyright (c) 2014-2025, Matthew Brett and the Delocate contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — packaging, typing_extensions, macholib |
| Maintenance | actively maintained — 561 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 598,544/month — #5,833 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: delocate-0.13.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
repairwheelRepairs wheels for cross-platform distribution…
permissive · top 15,000 on PyPI
comfy-anglePackages redistributable ANGLE graphics…
permissive · top 5,000 on PyPI
macholibAnalyzes and edits Mach-O headers, the…
permissive · top 5,000 on PyPI
cibuildwheelAutomates building and testing Python wheels…
permissive · top 5,000 on PyPI
relenvRelenv builds self-contained, reproducible…
unclear · top 15,000 on PyPI
scipy-openblas32Provides pre-built OpenBLAS shared libraries…
permissive · top 15,000 on PyPI
dlinfoProvides Python access to libc's dlinfo…
permissive · top 5,000 on PyPI
dlib-bindlib-bin provides pre-compiled binary wheels of…
unclear · top 5,000 on PyPI
delvewheelBundles DLL dependencies into Windows Python…
permissive · top 15,000 on PyPI
findlibsLocates shared libraries on the system by…
permissive · top 5,000 on PyPI