Skip to content

Build fails with setuptools >= 82: ModuleNotFoundError: No module named 'pkg_resources' #21

Description

@12458

editdistpy fails to build from source with setuptools >= 82.0.0 because setup.py imports pkg_resources.parse_version, which was removed in
setuptools v82.0.0
.

Error

ModuleNotFoundError: No module named 'pkg_resources'

Full traceback occurs during setuptools.build_meta.build_wheel when setup.py is executed.

Root Cause

setup.py line 23:

from pkg_resources import parse_version

pyproject.toml specifies setuptools>=77.0.3 with no upper bound, so setuptools v82+ can be resolved, which no longer ships pkg_resources.

Fix

Replace pkg_resources.parse_version with packaging.version.parse and add packaging to build-system.requires in pyproject.toml.

Environment

  • Python 3.12+
  • setuptools >= 82.0.0
  • uv

Relevant resouces:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions