#2354·qlib

collect_info.py does not start: pkg_resources is gone from setuptools 82

Author: LudwigJMarxCreated Sep 20, 2026Updated Sep 20, 2026

Bug Description

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

  1. 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.
  2. cd scripts && python collect_info.py all
  3. 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:

  • Qlib version: 0.9.8.dev34 (editable install)
  • Python version: 3.12.13
  • OS: MacOS 26.6.2, arm64
  • Commit number: be725493eb1a6bbb42bf11b37aa7669f59610ff1
  • setuptools 84.0.0

Additional Notes

#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.