Pin setuptools to avoid mlflow import failure (pkg_resources missing)

Open Beginner friendly
#13 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
devops

Research direction

Start by opening requirements.txt and checking how dependencies are currently specified. Add the requested setuptools constraint, then verify that the environment can import mlflow==2.10.0 without the pkg_resources error. Done means the dependency resolution prevents the reported import failure.

Written by the indexing model from the issue text.

Description

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

Dominant language
Python
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GSTT-CSC/MLOps-tutorial

All issues in GSTT-CSC/MLOps-tutorial

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.