PIPD is an advanced Python package management tool designed specifically for Debian-based systems. It bridges the gap between system package management (APT) and Python package management (PyPI), prioritizing system packages when available while providing seamless fallback to PyPI.
- π Intelligent Package Resolution: Automatically checks Debian repositories before PyPI
- π Familiar CLI Interface: Uses pip-like commands for ease of use
- π‘οΈ Transaction Support: Automatic rollback on installation failures
- π¦ Package Conversion: Converts PyPI packages to .deb format for system integration
- π Security First: Input validation, privilege checking, and safe execution
- β‘ Performance: Built-in caching to reduce redundant network calls
- π― PEP 668 Compliant: Works with externally managed Python environments
Modern Debian/Ubuntu systems implement PEP 668, which prevents pip from installing packages system-wide to avoid conflicts. PIPD solves this by:
- Prioritizing system packages: Safer and more stable
- Converting PyPI packages: Creates proper .deb packages
- Managing dependencies: Handles conflicts between system and PyPI packages
- Providing rollback: Failed installations don't leave your system broken
- Debian-based system (Debian 11+, Ubuntu 20.04+)
- Python 3.8 or higher
- Root privileges for installation
# Clone the repository
git clone https://github.com/mestadler/pipd.git
cd pipd
# Run the installer
sudo ./install-pipd.shThe installer will:
- Detect available Python versions
- Install system dependencies
- Set up the PIPD environment
- Configure logging and permissions
See docs/INSTALL.md for detailed manual installation instructions.
# Install packages
sudo pipd install requests numpy pandas
# Install specific version
sudo pipd install django==4.2
# Install from requirements file
sudo pipd install -r requirements.txt
# List installed packages
pipd list
# Show package information
pipd show requests
# Uninstall packages
sudo pipd uninstall requests# Force reinstall
sudo pipd install --force-reinstall numpy
# Upgrade packages
sudo pipd install --upgrade django
# List with different formats
pipd list --format json
pipd list --format simple
# Verbose mode for debugging
sudo pipd -v install tensorflowPIPD uses a TOML configuration file located at /etc/pipd/config.toml:
[general]
prefer_system_packages = true
cache_ttl = 3600
verbose = false
[sources]
check_debian_first = true
allow_pypi_fallback = true
[security]
verify_checksums = true
safe_mode = trueUser-specific configuration can be placed in ~/.config/pipd/config.toml.
PIPD follows a modular architecture:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLI Interface β
β (Click-based CLI) β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββ
β PipdOrchestrator β
β (Main coordination component) β
ββββββββ¬βββββββββββ¬ββββββββββββββ¬βββββββββββ¬βββββββββββ
β β β β
ββββββββ΄βββββ ββββ΄βββββββ ββββββ΄βββββ ββββ΄βββββββββ
β Package β βDebian β β PyPI β βDependency β
β Resolver β βManager β βManager β β Resolver β
βββββββββββββ βββββββββββ βββββββββββ βββββββββββββ
- PackageResolver: Resolves packages across Debian and PyPI sources
- DebianPackageManager: Handles APT operations
- PyPIPackageManager: Downloads and converts PyPI packages
- DependencyResolver: Manages dependency conflicts
- InstallationTransaction: Provides rollback capability
error: externally-managed-environmentThis is expected! PIPD is designed to work with this restriction by converting packages to .deb format.
Error: This script requires root privilegesSolution: Use sudo pipd install <package>
PIPD searches Debian repositories first. If a package isn't found:
- Check the package name spelling
- Update package lists:
sudo apt update - The package might only be available on PyPI
Enable verbose logging for troubleshooting:
sudo pipd -v install <package>Check logs at /var/log/pipd.log for detailed information.
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
# Clone the repository
git clone https://github.com/mestadler/pipd.git
cd pipd
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest tests/| Feature | PIPD | pip | pipx | apt |
|---|---|---|---|---|
| System package priority | β | β | β | β |
| PyPI packages | β | β | β | β |
| .deb conversion | β | β | β | N/A |
| Transaction rollback | β | β | β | β |
| PEP 668 compliant | β | β | β | N/A |
PIPD implements several security measures:
- Input validation for package names
- Privilege checking before system modifications
- Secure subprocess execution
- Optional checksum verification
This project is licensed under the MIT License - see the LICENSE file for details.
- Debian packaging team for the robust APT system
- Python Software Foundation for pip and venv
- py2deb and stdeb developers for package conversion tools
- Click developers for the excellent CLI framework
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Wiki: Project Wiki
Made with β€οΈ for the Debian/Ubuntu Python community
- Installation Guide - Detailed installation instructions
- User Manual - Comprehensive usage documentation
- PEP 668 Guide - Understanding PEP 668 and how PIPD handles it
- Python Compatibility - Python version support details
- Contributing - How to contribute to PIPD
pipd/ βββ pipd # Main executable βββ install-pipd.sh # Installation script βββ install-python312-debian.sh # Python 3.12 installer βββ README.md # This file βββ LICENSE # MIT License βββ CONTRIBUTING.md # Contribution guidelines βββ docs/ # Documentation β βββ INSTALL.md # Installation guide β βββ MANUAL.md # User manual β βββ PEP668.md # PEP 668 explanation β βββ PYTHON_COMPATIBILITY.md βββ examples/ # Example configurations β βββ config.toml.example β βββ requirements-example.txt βββ tests/ # Test suite β βββ test_pipd.py βββ scripts/ # Utility scripts βββ fix-pipd.sh βββ github-script.sh