Registry / devops / detect-installer

detect-installer

JSON →
library0.1.0pypypi✓ verified 85d ago

A Python library for detecting the installation method of a package (pip, pipx, uv, rye, etc.) and generating the correct upgrade command. Version 0.1.0, regularly updated.

pip install detect-installer
INSTALL
IMPORT
SIG · DETECT-INSTALLER
D
detect-installer
devopspythonv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

detect_installer
from detect_installer import detect_installer
import detect_installer
The module name and function are the same; importing without from leads to missing the function call.

Detect the installation method of the current package and get the upgrade command.

from detect_installer import detect_installer # Detect how 'detect-installer' itself was installed result = detect_installer() print(result) # e.g., {'tool': 'pip', 'command': 'pip install --upgrade detect-installer'}
Debug
Known issues
breakingThe function detect_installer() returns a dict, not a string. Access the 'command' key for the upgrade string.
fix
result['command'] to get the upgrade command.
affects: all
gotchadetect_installer() detects only the tool that installed the package; it may not detect nested or pipx- installed packages if not run in the correct environment.
fix
Run in the same Python environment where the target package is installed.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'detect_installer'
Package not installed, or installed in a different Python environment.
fix
Run 'pip install detect-installer' in the correct environment.
AttributeError: module 'detect_installer' has no attribute 'detect_installer'
Common mistake: import detect_installer instead of from detect_installer import detect_installer
fix
Use 'from detect_installer import detect_installer'
Upgrade
Version history
0.1.0latest on PyPI · released Feb 23, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources

No resource links recorded.

detect-installer — pip install detect-installer · libregistry