skillfed

delocate

Move macOS dynamic libraries into package

delocate v0.13.0 598.5K downloads/30d#5,833 on PyPI297
Permissive 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) Active released

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 delocate

uv

uv add delocate

poetry

poetry add delocate

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: MacOS :: MacOS XProgramming Language :: Python :: 3Topic :: Software Development :: Build ToolsTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

macOS wheel dynamic library bundlingmacos dylib relocation for wheelsfix wheel dependencies macosdelocate wheel macosbundle dylibs into python wheelmacos install_name rpath rewriting
macos-specificwheel-packagingbinary-relocation

More Python Modules packages