pip2sysdep is a command-line tool that maps Python package requirements to the system-level packages needed for successful pip install in a virtual environment. It helps you quickly determine and install the necessary OS packages for your Python dependencies, supporting both local and online mapping sources.
- Maps Python packages to system dependencies for various Linux distributions
- Supports both local and online mapping files (TOML format)
- Handles meta-groups and recursive dependency expansion
- Accepts input from command line, requirements.txt, or pyproject.toml
- Flexible output formatting (space or newline separated)
- Can run the system install command directly
- Python 3.11+ (uses
tomllibfrom the standard library)
Clone this repository and install the dependencies (if any):
# Clone the repo
git clone https://github.com/autiwire/pip2sysdep.git
cd pip2sysdep
# (Optional) Create a virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Run as module in venv
python3 -m pip2sysdep
# Run as script
python3 src/pip2sysdep.py$ python3 -m pip2sysdep bonsai
git
curl
wget
python3
python3-pip
python3-setuptools
python3-wheel
python3-venv
python3-dev
gcc
g++
make
build-essential
pkg-config
libldap2-dev
libsasl2-devpython3 -m pip2sysdep numpy requestspython3 -m pip2sysdep --local numpypython3 -m pip2sysdep --local=external/pip2sysdep/data/ubuntu-24.04.toml numpypython3 -m pip2sysdep --txt requirements.txtpython3 -m pip2sysdep --toml pyproject.tomlpython3 -m pip2sysdep --txt requirements.txt extra-packagepython3 -m pip2sysdep --txt requirements.txt --show-inputpython3 -m pip2sysdep numpy requests --separator=spacepython3 -m pip2sysdep numpy requests --install--helpShow help message and exit--local[=file]Use local mapping files (default: online lookup). If a file is given (with =), use it as the mapping TOML.--installRun the system package install command--separator=space|newlineOutput separator for system packages (default: newline)--txt <file>Read Python package names from requirements.txt-style file--toml <file>Read Python package names from pyproject.toml (PEP 621, Poetry, or PDM)--show-inputPrint the list of Python package names parsed from input and exit
- Mapping files are in TOML format and can be stored locally or fetched from the online repository.
- You can customize or extend mapping files for your own environment.
Contributions, bug reports, and feature requests are welcome! Please open an issue or submit a pull request on GitHub.
MIT License. See LICENSE for details.
This project is maintained by AutiWire GmbH.
Copyright (c) 2025 AutiWire GmbH