Skip to content

DeprecationWarning: pkg_resources is deprecated as an API in utils/module.py #7559

Closed

Description

@joshuacwnewton

The following warning has appeared in our pytest output:

=============================== warnings summary ===============================
python/envs/venv_sct/lib/python3.9/site-packages/monai/utils/module.py:396
  /home/runner/work/spinalcordtoolbox/spinalcordtoolbox/python/envs/venv_sct/lib/python3.9/site-packages/monai/utils/module.py:396:"""
DeprecationWarning: pkg_resources is deprecated as an API. 
See https://setuptools.pypa.io/en/latest/pkg_resources.html
    pkg = __import__(module)  # top level module
"""

MONAI version: 1.3.0

Skimming the MONAI source code, it seems like MONAI made this an optional import in #2482:

pkging, has_ver = optional_import("pkg_resources", name="packaging")

But, it seems like pkg_resources shouldn't be used at all: https://setuptools.pypa.io/en/latest/pkg_resources.html

Activity

  1. rukundob451 commented on Jul 15, 2024

    @rukundob451

    @joshuacwnewton is this issue still available?

  2. joshuacwnewton commented on Jul 18, 2024

    @joshuacwnewton
    Author

    Yes, I think so, given that there have been no changes to the MONAI codebase to remove the usage of pkg_resources. :)

  3. ken-ni commented on Jul 19, 2024

    @ken-ni
    Contributor

    I'm with CodeDay Labs 2024, my team is currently working on this.

  4. added a commit that references this issue on Aug 9, 2024
    6be7b13
  5. added a commit that references this issue on Sep 2, 2024
    10f78fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions