The latest stable upstream version is 2.13.0 and the current version in Ports is 0.13.2 (note the interesting reversal of the version numbers between the two). The version 0.13.2 installed from Ports fails with the latest pip, also from Ports: % pipdeptree Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/pipdeptree.py", line 17, in <module> from pip._internal.utils.misc import get_installed_distributions ImportError: cannot import name 'get_installed_distributions' from 'pip._internal.utils.misc' (/usr/local/lib/python3.9/site-packages/pip/_internal/utils/misc.py) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/bin/pipdeptree", line 33, in <module> sys.exit(load_entry_point('pipdeptree==0.13.2', 'console_scripts', 'pipdeptree')()) File "/usr/local/bin/pipdeptree", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/local/lib/python3.9/importlib/metadata.py", line 86, in load module = import_module(match.group('module')) File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/usr/local/lib/python3.9/site-packages/pipdeptree.py", line 20, in <module> from pip import get_installed_distributions, FrozenRequirement ImportError: cannot import name 'get_installed_distributions' from 'pip' (/usr/local/lib/python3.9/site-packages/pip/__init__.py) This was fixed upstream more than a year ago: https://github.com/tox-dev/pipdeptree/issues/155
<https://github.com/tox-dev/pipdeptree/releases/tag/1.0.0> … <https://github.com/tox-dev/pipdeptree/releases/tag/2.13.0>
I am not sure why portscout never catch it. I will push an update on my next batch of commit.
Committed at: https://cgit.FreeBSD.org/ports/commit/?id=a63c06a95f86146ea17dc6bac40da59a47c16b4c
I installed the latest version: % pkg info py39-pipdeptree py39-pipdeptree-2.13.0 Name : py39-pipdeptree Version : 2.13.0 Installed on : Wed Oct 11 08:29:48 2023 CEST Origin : devel/py-pipdeptree Architecture : FreeBSD:14:* Prefix : /usr/local Categories : python devel Licenses : MIT Maintainer : bofh@FreeBSD.org WWW : https://github.com/naiquevin/pipdeptree Comment : Command line utility to show dependency tree of packages Annotations : flavor : py39 repo_type : binary repository : FreeBSD Flat size : 156KiB Description : pipdeptree is a command line utility for displaying the installed python packages in form of a dependency tree. It works for packages installed globally on a machine as well as in a virtualenv. But it fails to run with ImportError: % pipdeptree Traceback (most recent call last): File "/usr/local/bin/pipdeptree", line 5, in <module> from pipdeptree.__main__ import main File "/usr/local/lib/python3.9/site-packages/pipdeptree/__main__.py", line 6, in <module> from pipdeptree._cli import get_options File "/usr/local/lib/python3.9/site-packages/pipdeptree/_cli.py", line 7, in <module> from .version import __version__ ImportError: cannot import name '__version__' from 'pipdeptree.version' (/usr/local/lib/python3.9/site-packages/pipdeptree/version.py) Any ideas why?
Reopening per comment #4.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=935065c7f7b49fc512df152f12859fcdd3ba476d commit 935065c7f7b49fc512df152f12859fcdd3ba476d Author: Muhammad Moinur Rahman <bofh@FreeBSD.org> AuthorDate: 2023-10-18 20:47:30 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2023-10-18 21:15:32 +0000 devel/py-pipdeptree: Fix runtime At runtime the program crashes due to an error like the following: ImportError: cannot import name '__version__' from 'pipdeptree.version' Which is caused due to the new template format of the setuptools_scm. Currently this is just a dirty hack to support older(<7) setuptools_scm format. PR: 274101 Reported by: vedran@miletic.net devel/py-pipdeptree/Makefile | 5 +++++ 1 file changed, 5 insertions(+)
Works great, thank you!