{"id":7323,"library":"johnnydep","title":"Johnnydep: Python Dependency Tree Viewer","description":"Johnnydep is a Python tool designed to display the dependency tree of Python distribution packages in a clear, tree-like structure. It helps developers efficiently manage project dependencies by visualizing all required components and their version constraints. The current version is 1.20.6, and it sees active development with frequent minor releases to support new `pip` versions and fix regressions.","status":"active","version":"1.20.6","language":"en","source_language":"en","source_url":"https://github.com/wimglenn/johnnydep","tags":["dependency","packaging","cli","analysis","tool"],"install":[{"cmd":"pip install johnnydep","lang":"bash","label":"Install Johnnydep"}],"dependencies":[{"reason":"Structured logging.","package":"structlog","optional":false},{"reason":"Rich terminal output for tree visualization and tables.","package":"rich","optional":false},{"reason":"Core library for Python package version and dependency specification handling. Requires >=20.0.","package":"packaging","optional":false},{"reason":"Used for parsing TOML configuration files.","package":"toml","optional":false},{"reason":"Used for locating and downloading Python packages. Requires >=0.6.0.","package":"unearth","optional":false},{"reason":"YAML parser. Requires >=6.0.1.","package":"PyYAML","optional":false}],"imports":[{"note":"Main class for representing a Python distribution and its dependencies programmatically.","symbol":"JohnnyDist","correct":"from johnnydep.lib import JohnnyDist"},{"note":"Function to generate a rich.tree.Tree object from a JohnnyDist instance.","symbol":"gen_tree","correct":"from johnnydep.lib import gen_tree"},{"note":"Function to generate a rich.table.Table object from a JohnnyDist instance.","symbol":"gen_table","correct":"from johnnydep.lib import gen_table"},{"note":"Function to flatten a dependency tree into a list.","symbol":"flatten_deps","correct":"from johnnydep.lib import flatten_deps"}],"quickstart":{"code":"johnnydep requests","lang":"bash","description":"Display the dependency tree for the 'requests' package directly from the command line."},"warnings":[{"fix":"Update any code relying on `dist.console_scripts` to expect a list of strings and iterate over it or join as needed, instead of splitting a string.","message":"The `dist.console_scripts` attribute, used for programmatic access to console script entry points, changed its return type from a comma-separated string to a `list` of strings in version 1.20.0.","severity":"breaking","affected_versions":"<1.20.0"},{"fix":"Ensure you are running the latest version of `johnnydep`. If encountering dependency resolution or parsing errors, try upgrading `johnnydep` with `pip install --upgrade johnnydep`.","message":"Johnnydep has had compatibility issues with specific `pip` versions, requiring updates. For instance, v1.20.5 added support for `pip>24`, and v1.20.4 fixed a regression with `pip 23.3`.","severity":"gotcha","affected_versions":"<1.20.5"},{"fix":"If running `johnnydep` with `packaging==22.0`, upgrade `packaging` to a newer version (e.g., `pip install --upgrade packaging`) or downgrade `packaging` if necessary.","message":"Version 1.20.1 blacklisted `packaging v22.0` due to an internal bug in that `packaging` release which could cause `johnnydep` to fail.","severity":"gotcha","affected_versions":"1.20.1"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure `johnnydep` is installed by running `pip install johnnydep`. If it's installed but still not found, confirm your `pip` script directory is in your PATH. On some systems, you might need to run `python -m johnnydep` instead of just `johnnydep`.","cause":"The `johnnydep` command-line tool is not installed, or your system's PATH environment variable does not include the directory where `pip` installs scripts.","error":"johnnydep: command not found"},{"fix":"Update your code to treat `JohnnyDist.console_scripts` as a list of strings, as its behavior changed in version 1.20.0. Iterate over the list or use `','.join(my_dist.console_scripts)` if you need a string representation.","cause":"This error can occur in programmatic usage if your code expects `JohnnyDist.console_scripts` (or similar entry point attributes) to be a string that can be called or split, but it is now a list.","error":"TypeError: 'str' object is not callable"},{"fix":"Upgrade your `packaging` library: `pip install --upgrade packaging`. If the issue persists, ensure `johnnydep` itself is up-to-date: `pip install --upgrade johnnydep`.","cause":"This specific error, or similar metadata parsing issues, can occur if an incompatible `packaging` library version is installed, particularly `packaging==22.0`, which was blacklisted by `johnnydep==1.20.1` due to a bug.","error":"packaging.version.InvalidVersion: Invalid version: '22.0.post0' (or similar errors during metadata parsing)"}]}