detect-installer
Detect how a Python package was installed and get the correct upgrade command.
Supports pip, uv (project and pip modes), uv tool, pipx, Homebrew, Conda, and Mamba.
Installation
pip install detect-installer
Usage
from detect_installer import detect_installer
info = detect_installer("rich")
if info is None:
print("Package is not installed")
else:
print(info.installer) # e.g. Installer.PIP
print(info.upgrade_cmd) # e.g. "pip install -U rich"
Vendoring
This library has zero dependencies and is published under the
0BSD license, so you can copy
src/detect_installer/_detect.py directly into your project if you'd
prefer to avoid adding a dependency.
License
0BSD - free to use, copy, modify, and distribute with or without fee.
Release files for detect-installer 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| detect_installer-0.2.1.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| detect_installer-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.0 kB
Release files / detect_installer-0.2.1.tar.gz
| Download URL | detect_installer-0.2.1.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85f889d4d19c1caf5bef89ef389eb920cd8c6c2a868e1eeceec24527b93021e7
|
|
BLAKE2b-256 checksum How to use checksums |
cdeb77b0cc7fc0235b0495b32410edebe14cf6757b826135a7f92bb0f5d843b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / detect_installer-0.2.1-py3-none-any.whl
| Download URL | detect_installer-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87e2ce7d05cb108b178f8e45bb80d3d88c0cb4b397983345c18ad6562e02e620
|
|
BLAKE2b-256 checksum How to use checksums |
61fea245e1d579e7abf47208f7c1ce5684caa2cd956ede5ff646d66d0299d9e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|