--- id: detect-installer version: "0.1.0" license: 0BSD license_treatment: permissive maintenance: active --- # detect-installer — Detect how a Python package was installed and get the correct upgrade command License: permissive · Maintenance: active · Downloads: 13.4M/mo ## What it is and what it does detect-installer identifies which package manager was used to install a Python package on the current system and generates the correct upgrade command for that manager. It supports pip, uv (both project and pip modes), uv tool, pipx, Homebrew, Conda, and Mamba. The package has no runtime dependencies and is published under a permissive license, making it suitable for vendoring directly into projects if you want to avoid adding a dependency. The typical use case is in tools or scripts that need to upgrade packages but must use the same installer that originally installed them. For example, a package manager wrapper or development utility might call detect_installer to determine whether to run `pip install -U`, `uv pip install -U`, `pipx upgrade`, or a conda/mamba equivalent. Use it for: - Build tools or package managers that need to upgrade dependencies using the same installer that installed them. - Development utilities that auto-upgrade packages and must preserve the user's original installation method. - CLI applications that guide users on how to upgrade themselves based on their installation method. - Testing frameworks that verify package upgrades work correctly across different installer ecosystems. - Documentation generators or setup helpers that detect and report on the current installation method. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Detects which package manager installed a given Python package and returns the correct upgrade command for that installer. Yes. The package solves a real problem with zero dependencies, active maintenance, no known vulnerabilities, and a permissive license. It's lightweight and either installable normally or vendorable directly into your project. Install it if you need to detect or recommend upgrade commands based on how a package was installed. ## Install pip install detect-installer uv add detect-installer poetry add detect-installer ## Installing detect-installer Before you install: Low friction: zero runtime dependencies and a pure-Python wheel. Maintenance status is active with a recent release. License in practice: 0BSD is permissive and places no restrictions on use, modification, or distribution. The package explicitly notes it can be vendored directly into projects to avoid adding a dependency. Quickstart: pip install detect-installer from detect_installer import detect_installer info = detect_installer("rich") if info: print(info.upgrade_cmd) Requires Python 3.10 or later. Verify before relying: - Whether detection works reliably across all supported installers (pip, uv, pipx, Homebrew, Conda, Mamba) in edge cases. - How the package handles packages installed via multiple methods or in virtual environments created by different tools. ## Package facts - License: 0BSD (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 13.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags detect package manager, python installer detection, upgrade command generator, pip uv pipx conda detection, package installation method, find how package was installed, get upgrade command, package-management, installer-detection [View on SkillFed](https://skillfed.io/packages/detect-installer) · [View on PyPI](https://pypi.org/project/detect-installer/)