Skip to main content

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for detect-installer 0.2.0
File Size Uploaded
detect_installer-0.2.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for detect-installer 0.2.0
File Interpreter ABI Platform
detect_installer-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / detect_installer-0.2.0.tar.gz

Download URL detect_installer-0.2.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0f0d8f15c996a8c2b7710e8e780dff1399a9a55957603846c3bc9b0d2db657eb
BLAKE2b-256 checksum
How to use checksums
7039167d21ee02988e3c02d7dfb6d93c6da0ebe8cbb712862d8867b39676c677
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.0-py3-none-any.whl

Download URL detect_installer-0.2.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
92d04d894e6af8d75eb52f07147f837e69079042a2d214e6ae0caa096c24f3a1
BLAKE2b-256 checksum
How to use checksums
1a5a28f4f46c7ea0c25fcb3491a8ddfcdb8ad95ef74cbd70e3552185fa3d35e0
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 history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page