Skip to content

Replace deprecated pkg_resources with packaging.version - #4812

Open
euphoricmangat wants to merge 1 commit into
bulletphysics:masterfrom
euphoricmangat:fix/replace-pkg-resources-with-packaging
Open

euphoricmangat wants to merge 1 commit into
bulletphysics:masterfrom
euphoricmangat:fix/replace-pkg-resources-with-packaging

Conversation

@euphoricmangat

Copy link
Copy Markdown

Gym example envs imported parse_version from pkg_resources, which is deprecated and removed in newer setuptools. Use packaging.version.parse instead, and drop unused imports.

Fixes #4779

Gym example envs imported parse_version from pkg_resources, which is
deprecated and removed in newer setuptools. Use packaging.version.parse
instead, and drop unused imports.

Fixes bulletphysics#4779

Co-authored-by: Cursor <cursoragent@cursor.com>
@euphoricmangat

Copy link
Copy Markdown
Author

Hello

I am new to the oss world. I have used pybullet many time so a PR for issue #4779 seems like a good entry point.

Several PyBullet gym envs import parse_version from pkg_resources just to check whether gym.__version__ is older than 0.9.6 (legacy API aliases). pkg_resources is deprecated and gone in newer setuptools, so those imports break.

Changes:

  • In the 10 files that actually use it, switched to from packaging.version import parse as parse_version so the same comparison still works.
  • In cartpole_bullet.py and deep_mimic_env.py, removed the import entirely — it was unused.

No behavior change intended for current gym versions; this only updates the version-parsing import.

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.

examples/pybullet/gym/pybullet_envs/bullet use no longer available pkg_resources

1 participant