shiv
A command line utility for building fully self contained Python zipapps.
What it is and what it does
shiv is a command-line tool that packages a Python application and all its dependencies into a single executable zipapp file (a .pyz file), following PEP 441. Instead of requiring users to install Python and then use pip to fetch dependencies, you distribute one self-contained binary that runs immediately. It accepts almost all pip install options, so you can specify versions, extras, and sources just as you would with pip.
The tool is designed for developers who want to distribute Python CLI tools or applications without forcing end-users to manage Python environments. You specify a console script entry point (like flake8) and shiv bundles everything needed to run it. The generated zipapp extracts itself into ~/.shiv (or a custom SHIV_ROOT) on first run. A key limitation: zipapps with native C extensions may not work across different operating systems or architectures—a .pyz built on macOS typically only runs on macOS.
Use it for:
- Package a CLI tool like flake8 into a single executable that users can download and run without installing Python.
- Distribute internal company tools as standalone binaries that don't require dependency management on target machines.
- Create a Python REPL bundle with preloaded libraries (e.g., boto) that users can invoke interactively without setup.
- Build cross-platform Python applications where all dependencies are pure Python and architecture-independent.
- Simplify CI/CD pipelines by generating immutable, self-contained application artifacts instead of managing virtual environments.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
shiv builds self-contained Python zipapps (PEP 441) that bundle an application and all its dependencies into a single executable file, eliminating the need for separate installation steps.
Yes. shiv is actively maintained, has low install friction, no security vulnerabilities, and solves a real distribution problem for Python CLI tools and applications. Install it if you need to package Python applications as standalone executables; skip it if your users already have Python environments or if your dependencies include platform-specific C extensions that must work across multiple architectures.
Install
shiv on PyPI
pip
pip install shivuv
uv add shivpoetry
poetry add shivInstalling shiv
Before you install
Low friction installation via pip with a pure-wheel distribution. The package is actively maintained (last commit 2026-05-22) and supports current Python versions (3.8+). Runtime dependencies are lightweight and widely available (click, pip, setuptools, importlib-resources).
License in practice
BSD License (permissive) means you can use shiv freely in commercial and private projects with minimal restrictions, requiring only license attribution.
Quickstart
pip install shiv
shiv -c flake8 -o ~/bin/flake8 flake8
~/bin/flake8 --version
Requires Python 3.6+; zipapps with C extensions may not be cross-platform compatible (e.g., a .pyz built on macOS may only run on macOS).
Verify before relying
- Whether the generated zipapps work reliably with all dependency types (pure Python vs. C extensions) in production environments.
- Performance overhead of zipapp extraction into ~/.shiv on repeated invocations.
- Compatibility guarantees with future Python versions beyond 3.11.
Package facts
| License | BSD License (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — click, pip, setuptools, importlib-resources |
| Maintenance | actively maintained — 651 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 425,118/month — #6,761 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: shiv-1.0.8-py2.py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
pexPex generates standalone, executable Python…
permissive · top 5,000 on PyPI
wheywhey is a PEP 517 build backend that creates…
permissive · top 15,000 on PyPI
delvewheelBundles DLL dependencies into Windows Python…
permissive · top 15,000 on PyPI
relenvRelenv builds self-contained, reproducible…
unclear · top 15,000 on PyPI
johnnydepJohnnydep displays the full dependency tree of…
permissive · top 15,000 on PyPI
source-distributionDistributes Python source code as a package;…
unclear · top 15,000 on PyPI
pyinstallerPyInstaller bundles a Python application and…
copyleft · top 5,000 on PyPI
pyinstxtractor-ngExtracts Python bytecode and resources from…
copyleft · top 15,000 on PyPI
pytailwindcssInstalls and wraps the standalone Tailwind CSS…
permissive · top 15,000 on PyPI
poetry-corepoetry-core is a PEP 517 build backend that…
permissive · top 1,000 on PyPI