Skip to content

Pin setuptools to avoid mlflow import failure (pkg_resources missing) #13

@samdporter

Description

@samdporter

mlflow==2.10.0 imports pkg_resources, but our environment currently resolves setuptools to latest, where pkg_resources may be unavailable. This causes:
ModuleNotFoundError: No module named 'pkg_resources'

Easy fix is to add setuptools<81 to requirements.txt

This triggers a deprecation warning:

UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. 
The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources  # noqa: TID251

But works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions