You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
collect_info.py does not start: pkg_resources is gone from setuptools 82 #2354
scripts/collect_info.py aborts on its first import. This is the script the
bug report template points users to for their environment details.
Two causes, one behind the other, both in the same file:
cause
effect
1
import pkg_resources at module level
ModuleNotFoundError, the script never starts
2
REQUIRED lists wheel and cython
DistributionNotFound, the script dies part way through its output
The second one only becomes visible once the first is fixed. wheel and cython sit in build-system.requires, not in dependencies, so a plain pip install pyqlib does not have them.
To Reproduce
Install qlib in an environment with setuptools 82 or newer. Since Python
3.12 python -m venv no longer seeds setuptools at all, so pkg_resources
can be missing regardless of any version boundary.
cd scripts && python collect_info.py all
Output:
Traceback (most recent call last):
File "scripts/collect_info.py", line 5, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
Measured boundary, one throwaway venv per version, nothing else changed:
setuptools
ships pkg_resources
80.9.0
yes
81.0.0
yes, with a deprecation warning
82.0.0
no
Expected Behavior
collect_info.py all prints the system, Python and package details and exits
with 0, including when a package from its list is not installed.
Environment
Collected by hand, since the script itself does not run:
#1947 covers the same line, but from June 2025, when it was still a UserWarning with a different traceback behind it. Today the script does not
start at all.
That fixes cause 1. Cause 2 (wheel/cython listed in REQUIRED but living in build-system.requires) is independent and still worth fixing separately — the importlib.metadata change doesn't move them out of REQUIRED.
Activity
test(scripts): make the missing-package branch independent of the mac…
rytjy commentedon Oct 10, 2026
Can confirm, same file (
scripts/collect_info.py):L5:import pkg_resourcesat module level → on setuptools 82 this raisesModuleNotFoundErrorbefore anything runs;L60:version = pkg_resources.get_distribution(package).version→ the only other use.Since
pkg_resourcesis going away, the drop-in for both isimportlib.metadata, which removes the setuptools dependency entirely:That fixes cause 1. Cause 2 (
wheel/cythonlisted inREQUIREDbut living inbuild-system.requires) is independent and still worth fixing separately — theimportlib.metadatachange doesn't move them out ofREQUIRED.