Skip to content

pkg_resources is deprecated in python 3.12 #390

Open
@newearthmartin

Description

I just upgraded to Python 3.12 and I'm getting a deprecation warning about pkg_resources

.../newsletter/__init__.py:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import get_distribution, DistributionNotFound

According to https://setuptools.pypa.io/en/latest/pkg_resources.html it should be replaced by importlib.resources:

Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Participants

    @newearthmartin

    Issue actions

      pkg_resources is deprecated in python 3.12 · Issue #390 · jazzband/django-newsletter