Current Behaviour
profile_report.py imports pkg_resources directly (line 11), which was removed
from setuptools>=81. This causes ModuleNotFoundError: No module named 'pkg_resources'
on fresh environments with modern setuptools.
The utils/versions.py file already uses importlib.metadata with a fallback —
but profile_report.py was not updated.
Affected code
src/ydata_profiling/profile_report.py (lines 11 and 362)
Proposed fix
Replace pkg_resources.get_distribution("Pillow").version with
importlib.metadata.version("Pillow"), which is available since Python 3.8.
Validation
Full test suite passes with the change on Python 3.13.5 (2195 passed, 4 skipped, 0 failures).
I'd like to work on this. Will open a PR once approved.
Expected Behaviour
ydata-profiling should work without requiring setuptools/pkg_resources at runtime.
Data Description
N/A - not data related
Code that reproduces the bug
pip install setuptools>=81
python3 -c "from ydata_profiling import ProfileReport"
# ModuleNotFoundError: No module named 'pkg_resources'
pandas-profiling version
4.18.1 (develop branch)
Dependencies
setuptools==78.1.1 (tested); bug triggers on setuptools>=81 where pkg_resources was removed
Python 3.13.5
OS
Linux (Parrot OS)
Checklist
Current Behaviour
profile_report.pyimportspkg_resourcesdirectly (line 11), which was removedfrom
setuptools>=81. This causesModuleNotFoundError: No module named 'pkg_resources'on fresh environments with modern setuptools.
The
utils/versions.pyfile already usesimportlib.metadatawith a fallback —but
profile_report.pywas not updated.Affected code
src/ydata_profiling/profile_report.py(lines 11 and 362)Proposed fix
Replace
pkg_resources.get_distribution("Pillow").versionwithimportlib.metadata.version("Pillow"), which is available since Python 3.8.Validation
Full test suite passes with the change on Python 3.13.5 (2195 passed, 4 skipped, 0 failures).
I'd like to work on this. Will open a PR once approved.
Expected Behaviour
ydata-profiling should work without requiring setuptools/pkg_resources at runtime.
Data Description
N/A - not data related
Code that reproduces the bug
pandas-profiling version
4.18.1 (develop branch)
Dependencies
OS
Linux (Parrot OS)
Checklist