Skip to content

Warning on import cpmpy: exact.py:52: UserWarning: pkg_resources is deprecated as an API. #709

@hbierlee

Description

@hbierlee

When cpmpy 0.9.25 is imported, I get the following warning:

> python -c "import cpmpy"
/home/hbierlee/Projects/cpmpy/venv/lib/python3.12/site-packages/cpmpy/solvers/exact.py:52: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources p
ackage is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources

Even though Exact is not installed. On the master (#14e9a064) branch, I get the same warning for gurobi (also not installed):

> python -c "import cpmpy"
/home/hbierlee/Projects/cpmpy/cpmpy/solvers/gurobi.py:46: 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 e
arly as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources

It's probably good to see if we can avoid these distracting warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions