Description of problem: Whenever I run reuse, it immediately crashes. Version-Release number of selected component (if applicable): reuse-0.12.1-3.fc35.noarch How reproducible: Always Steps to Reproduce: 1. Run reuse. Actual results: Traceback (most recent call last): File "/usr/bin/reuse", line 33, in <module> sys.exit(load_entry_point('reuse==0.12.1', 'console_scripts', 'reuse')()) File "/usr/bin/reuse", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 162, in load module = import_module(match.group('module')) File "/usr/lib64/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/usr/lib/python3.10/site-packages/reuse/_main.py", line 14, in <module> from . import ( File "/usr/lib/python3.10/site-packages/reuse/download.py", line 17, in <module> from ._util import ( File "/usr/lib/python3.10/site-packages/reuse/_util.py", line 26, in <module> from debian.copyright import Copyright File "/usr/lib/python3.10/site-packages/debian/copyright.py", line 54, in <module> from debian import deb822 File "/usr/lib/python3.10/site-packages/debian/deb822.py", line 283, in <module> import debian.debian_support File "/usr/lib/python3.10/site-packages/debian/debian_support.py", line 46, in <module> apt_pkg.init() apt_pkg.Error: W:Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory), E:Unable to determine a suitable packaging system type Expected results: I expect it to display a help message. Workaround: $ mkdir venv $ python -m venv venv/ $ source venv/bin/activate $ pip install --upgrade pip setuptools # Optional $ pip install reuse
It seems unlikely the fault is in this package but something to do with python-debian (or its dependencies) which reuse requires. A minimal way to reproduce the same problem on a fresh Fedora 33/34 or 35: $ sudo dnf install -y python-debian $ echo "import debian.debian_support" | python In addition to workaround from swagfortress above you can also remove the dnf package (which also removes python-debian, python-apt and apt-libs) and use pip directly: `sudo dnf remove reuse && pip install reuse` I've raised a bug against python-debian linked to this: https://bugzilla.redhat.com/show_bug.cgi?id=2014636
Indeed, this error is caused by python-debian failing to import one of its dependencies. I've gone into some detail on REUSE's upstream bug tracker (https://github.com/fsfe/reuse-tool/issues/425#issuecomment-979181897). I'll quote it below: > ... It occurs due to the presence of python3-apt, which is a 'recommended' dependency in the Fedora package for python-debian. > > If python3-apt is present, python-debian also expects a valid APT configuration directory, which clearly does not exist on a typical Fedora system! > > Neal Gompa added the recommended dependency in Fedora, but told me that even that was a compromise for other users who do actually use APT on Fedora (!), so it can't just be removed. As of yesterday I now have a Debian Salsa account though, so I'll be sending a pull request upstream to make python-debian more resilient to the absence of an APT configuration directory. That should hopefully resolve the issue! :)
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle. Changing version to 36.
Patches submitted against https://bugzilla.redhat.com/show_bug.cgi?id=2014636 have fixed this in F34 and F35 now, so presumably this can be closed.
Verified in F35 and later using mock chroots. See also bug 2135361.