Skip to content

Conversation

@Chowdhury-Anik
Copy link

This fixes the deprecation warning by migrating from pkg_resources to importlib.resources.

Changes:

  • Replaced 'from pkg_resources import resource_filename' with 'from importlib.resources import files'
  • Updated all resource_filename(name, path) calls to str(files(name).joinpath(path))

This ensures compatibility with Python 3.7+ and Setuptools >= 81.0.0.

Fixes ageitgey/face_recognition#1645

This fixes the deprecation warning by migrating from pkg_resources to importlib.resources.

Changes:
- Replaced 'from pkg_resources import resource_filename' with 'from importlib.resources import files'
- Updated all resource_filename(__name__, path) calls to str(files(__name__).joinpath(path))

This ensures compatibility with Python 3.7+ and Setuptools >= 81.0.0.

Fixes ageitgey/face_recognition#1645
Copy link

@turicas turicas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR correctly fixes #21.

add the missing ' )' in str(files(__name__).joinpath(...))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning: pkg_resources is deprecated - Migration to importlib.resources needed

3 participants