{"id":44717,"library":"detect-installer","title":"detect-installer","description":"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.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/ofek/detect-installer","tags":["installer","detection","pip","uv","rye","pipx"],"install":[{"cmd":"pip install detect-installer","lang":"bash","label":"latest stable release"}],"dependencies":[],"imports":[{"note":"The module name and function are the same; importing without from leads to missing the function call.","wrong":"import detect_installer","symbol":"detect_installer","correct":"from detect_installer import detect_installer"}],"quickstart":{"code":"from detect_installer import detect_installer\n\n# Detect how 'detect-installer' itself was installed\nresult = detect_installer()\nprint(result)  # e.g., {'tool': 'pip', 'command': 'pip install --upgrade detect-installer'}","lang":"python","description":"Detect the installation method of the current package and get the upgrade command."},"warnings":[{"fix":"result['command'] to get the upgrade command.","message":"The function detect_installer() returns a dict, not a string. Access the 'command' key for the upgrade string.","severity":"breaking","affected_versions":"all"},{"fix":"Run in the same Python environment where the target package is installed.","message":"detect_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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.1.0':27 'command':25 'correct':23 'detect':2,8,31 'detect-instal':1 'etc':19 'generat':21 'instal':3,10,30 'librari':6 'method':11 'packag':14 'pip':15,32 'pipx':16,35 'python':5 'regular':28 'rye':18,34 'updat':29 'upgrad':24 'uv':17,33 'version':26","created_at":"2026-06-07T12:51:29.580327+00:00","updated_at":"2026-06-07T12:51:29.580327+00:00","problems":[{"fix":"Run 'pip install detect-installer' in the correct environment.","cause":"Package not installed, or installed in a different Python environment.","error":"ModuleNotFoundError: No module named 'detect_installer'"},{"fix":"Use 'from detect_installer import detect_installer'","cause":"Common mistake: import detect_installer instead of from detect_installer import detect_installer","error":"AttributeError: module 'detect_installer' has no attribute 'detect_installer'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}