skillfed

patchelf

A small utility to modify the dynamic linker and RPATH of ELF executables.

patchelf v0.19.1.0 13.8M downloads/30d#1,264 on PyPI12
Copyleft license GPL-3.0-or-later Active released

What it is and what it does

patchelf is a packaging of the upstream NixOS patchelf utility, distributed via PyPI for easy installation. It modifies ELF executables' dynamic linker and RPATH settings, which is essential for binary wheel portability and compatibility across Linux distributions. The package provides pre-built binaries for multiple architectures and libc variants (glibc, musl), eliminating the need to compile patchelf from source.

This is primarily a command-line tool packaged for Python environments. It has no runtime dependencies and is commonly used in build pipelines for auditwheel, manylinux, and musllinux workflows—scenarios where you need to adjust how compiled binaries locate their dependencies. The package is actively maintained and supports modern Python versions.

Use it for:

  • Building manylinux or musllinux wheels that need to adjust RPATH in compiled extensions
  • Automating binary patching in CI/CD pipelines without requiring system package managers
  • Modifying ELF executables' dynamic linker for cross-distribution compatibility
  • Dependency for auditwheel or similar tools that repair wheel portability
  • Development environments where patchelf must be available as a Python dependency

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a PyPI-packaged binary of patchelf, a utility for modifying the dynamic linker and RPATH of ELF executables.

Yes, if you need patchelf in a Python environment or build pipeline. It offers zero runtime dependencies, active maintenance, and broad platform coverage via pre-built wheels. The GPLv3+ copyleft applies only to modifications; using the binary carries no redistribution obligation. Install friction is medium due to platform-specific wheels, but that is unavoidable for a compiled utility.

Install

patchelf on PyPI

pip

pip install patchelf

uv

uv add patchelf

poetry

poetry add patchelf

Installing patchelf

Before you install

Medium install friction due to platform-specific binary wheels. Active maintenance with recent releases (6 days since last update). No runtime dependencies simplifies deployment.

License in practice

Dual-licensed under Apache 2.0 and GPLv3+. The copyleft GPLv3+ component means derivative works or modifications must be released under compatible terms; using the binary as-is carries no obligation, but redistributing modified versions requires GPL compliance.

Quickstart

pip install patchelf

import patchelf
# patchelf is primarily a command-line tool; Python usage depends on the underlying binary

Requires a supported platform with a pre-built wheel (Linux x86_64, aarch64, armv7l, ppc64le, s390x, riscv64, i686, or macOS universal2). Python >= 3.7.

Verify before relying

  • Whether the package exposes a Python API or is primarily a CLI wrapper around the patchelf binary
  • Specific use cases within auditwheel, manylinux, or musllinux workflows that this packaging enables

Package facts

License GPL-3.0-or-later (copyleft)
Python support supports the current Python release (>=3.7)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 6 days since the last release
Last repo commit
First released
Downloads 13,780,922/month — #1,264 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: patchelf-0.19.1.0-py3-none-macosx_10_9_universal2.whl; patchelf-0.19.1.0-py3-none-manylinux1_i686.manylinux_2_5_i686.musllinux_1_1_i686.whl; patchelf-0.19.1.0-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.musllinux_1_1_x86_64.whl; patchelf-0.19.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_1_aarch64.whl; patchelf-0.19.1.0-py3-none-manylinux2014_armv7l.manylinux_2_17_armv7l.musllinux_1_1_armv7l.whl; patchelf-0.19.1.0-py3-none-manylinux2014_ppc64le.manylinux_2_17_ppc64le.musllinux_1_1_ppc64le.whl; patchelf-0.19.1.0-py3-none-manylinux2014_s390x.manylinux_2_17_s390x.musllinux_1_1_s390x.whl; patchelf-0.19.1.0-py3-none-manylinux_2_31_riscv64.musllinux_1_1_riscv64.whl

Keywords: auditwheel, elf, manylinux, musllinux, patchelf

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseLicense :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)Operating System :: POSIX :: LinuxProgramming Language :: CProgramming Language :: C++Programming Language :: PythonTopic :: Software Development :: Build Tools

Tags

modify elf executablespatchelf binarydynamic linker modificationrpath patchingelf binary patchingauditwheel dependencymanylinux wheel tools
elf-binary-toolsbuild-automationwheel-packaging

More Build Tools packages