{"id":314,"library":"distlib","title":"distlib: Distribution Utilities","description":"distlib is a Python library that provides low-level functions for packaging and distributing Python software, serving as a foundation for third-party packaging tools. The current version is 0.4.0, released on July 17, 2025. The project is actively maintained with regular updates.","status":"active","version":"0.4.0","language":"python","source_language":"en","source_url":"https://github.com/pypa/distlib","tags":["packaging","distribution","Python","utilities"],"install":[{"cmd":"pip install distlib","lang":"bash","label":"Install distlib"}],"dependencies":[],"imports":[{"note":"Ensure correct import path to access the Database class.","symbol":"Database","correct":"from distlib.database import Database"},{"note":"Ensure correct import path to access the Index class.","symbol":"Index","correct":"from distlib.index import Index"}],"quickstart":{"code":"from distlib.database import Database\nfrom distlib.index import Index\n\n# Initialize the database\ndb = Database()\n\n# Initialize the index\nindex = Index()\n\n# Example usage of the database and index\n# (Replace with actual functionality as needed)\nprint(db)\nprint(index)","lang":"python","description":"A basic example demonstrating the initialization and usage of distlib's Database and Index classes."},"warnings":[{"fix":"Review the distlib 0.4.0 release notes and update your code to align with the new class implementations.","message":"distlib 0.4.0 introduces changes to the Database and Index classes that may require updates to existing codebases.","severity":"breaking","affected_versions":"0.3.x"},{"fix":"Update import statements to match the new module structure as per the distlib 0.4.0 documentation.","message":"Ensure that all import statements reference the correct module paths to avoid ImportError due to module restructuring in distlib 0.4.0.","severity":"gotcha","affected_versions":"0.4.0"}],"env_vars":null,"last_verified":"2026-05-12T13:00:32.388Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Ensure 'distlib' is installed by running: `pip install distlib`","cause":"The 'distlib' library is not installed in the Python environment currently in use, or the environment's paths are not correctly configured. This error often appears when 'distlib' is an indirect dependency of other tools like 'pip' or 'virtualenv'.","error":"ModuleNotFoundError: No module named 'distlib'"},{"fix":"Reinstall 'distlib' along with the potentially conflicting tool (e.g., 'virtualenv' or 'pip') to resolve version inconsistencies: `pip uninstall distlib virtualenv` then `pip install virtualenv`","cause":"This error typically occurs due to a version mismatch or a corrupted installation of the 'distlib' library, especially when a tool like 'virtualenv' or 'pip' attempts to import a specific utility that has changed or is missing in the installed 'distlib' version.","error":"ImportError: cannot import name 'enquote_executable' from 'distlib.scripts'"},{"fix":"Upgrade 'pip' and 'setuptools' to their latest versions: `pip install --upgrade pip setuptools`. If the issue persists, consider reinstalling pip: `python -m pip uninstall pip` followed by `python -m ensurepip` and then `python -m pip install --upgrade pip`","cause":"This 'AttributeError' often indicates an incompatibility between different versions of 'pip' and 'setuptools', or an issue with the version of 'distlib' bundled within 'pip'. It can also be related to an outdated `testpath` library.","error":"AttributeError: _DistInfoDistribution__dep_map"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}