Skip to content

Fix: remove pkg_resources usage (deprecated), use importlib.metadata#2389

Merged
3b1b merged 1 commit into3b1b:masterfrom
m-awais-khan:fix-remove-pkg-resources
Feb 10, 2026
Merged

Fix: remove pkg_resources usage (deprecated), use importlib.metadata#2389
3b1b merged 1 commit into3b1b:masterfrom
m-awais-khan:fix-remove-pkg-resources

Conversation

@m-awais-khan
Copy link
Copy Markdown
Contributor

@m-awais-khan m-awais-khan commented Sep 9, 2025

Motivation

Currently, running manimgl on Python 3.13+ produces a warning:

UserWarning: pkg_resources is deprecated as an API...

This happens because manimlib/__init__.py imports pkg_resources only to retrieve the package version.
Since pkg_resources is deprecated and scheduled for removal after 2025-11-30, this will eventually break ManimGL.

Proposed changes

  • Removed the dependency on pkg_resources in manimlib/__init__.py.
  • Replaced it with importlib.metadata, the recommended standard library API (Python ≥3.8).
  • Added a fallback for when the package version cannot be determined.

Test

Code:

manimgl

Result:

ManimGL v1.7.2

No deprecation warning is shown, and the version is still correctly displayed.

Closes #2388

@azhuchkov
Copy link
Copy Markdown
Contributor

Looks similar to #2360.

@3b1b 3b1b merged commit 5d397a7 into 3b1b:master Feb 10, 2026
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.

Deprecation warning: pkg_resources is deprecated, replace with importlib.metadata

3 participants