Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #113, No module named 'pkg_resources' #114

Merged
merged 3 commits into from
Apr 29, 2024
Merged

Fix #113, No module named 'pkg_resources' #114

merged 3 commits into from
Apr 29, 2024

Conversation

zacharysyoung
Copy link
Contributor

The following two-line patch attempts to fix #113 by changing from the deprecated pkg_resources to importlib.

I looked up pkg_resources and found this landing page for setuptools and a deprecation notice:

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.

I don't understand pkg_resources or importlib, but happened to find importlib.resources.open_binary() which seemed like a good fit to replace pkg_resources.resource_stream().

@maxpmaxp maxpmaxp merged commit e18016c into maxpmaxp:master Apr 29, 2024
@zacharysyoung zacharysyoung deleted the Fix-pkg_resources-NoModule branch April 29, 2024 18:10
@maxpmaxp
Copy link
Owner

@zacharysyoung thanks for the contribution!

@zacharysyoung
Copy link
Contributor Author

zacharysyoung commented Apr 30, 2024 via email

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.

No module named 'pkg_resources'
2 participants