detect-installer
Detect how a Python package was installed and get the correct upgrade command
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 on this page — 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
detect-installer on PyPI
pip
pip install detect-installeruv
uv add detect-installerpoetry
poetry add detect-installerInstalling 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 the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 172 days since the last release |
| First released | |
| Downloads | 13,405,742/month — #1,282 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: detect_installer-0.1.0-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pipmasterProgrammatically ensures Python packages are…
permissive · top 15,000 on PyPI
pre-commit-uvIntegrates uv as the virtual environment and…
permissive · top 15,000 on PyPI
PyPgConfigPyPgConfig detects and exposes PostgreSQL…
permissive · top 15,000 on PyPI
shellinghamShellingham detects which shell the current…
permissive · top 1,000 on PyPI
updateProvides a check() function to detect available…
permissive · top 15,000 on PyPI
ggshieldggshield is a CLI tool that scans files,…
permissive · top 15,000 on PyPI
darkdetectDetects whether the operating system is in Dark…
permissive · top 5,000 on PyPI
detect-delimiterDetects the delimiter character used in CSV,…
permissive · top 15,000 on PyPI
lib-detect-testenvDetects whether code is running in a test…
permissive · top 5,000 on PyPI
napari-plugin-managerProvides a graphical interface for discovering,…
permissive · top 15,000 on PyPI