fix(deps): add missing gym dependency for RL environments (#7)#23
Open
bradsmithmba wants to merge 1 commit into
Open
fix(deps): add missing gym dependency for RL environments (#7)#23bradsmithmba wants to merge 1 commit into
bradsmithmba wants to merge 1 commit into
Conversation
src/environments/{base,options_env}.py and the RL training path import
`gym` / `from gym import spaces`, but gym was absent from requirements.txt,
so the entire environments subsystem failed at import (ModuleNotFoundError)
and all environment tests errored at collection.
Add gym>=0.26.2. Verified on Python 3.13: gym imports and all 131 tests
under tests/environments/ pass. gym is unmaintained (no NumPy 2.0 support
for its full feature set), but the codebase only uses gym.spaces, which
works; a migration to gymnasium is noted inline as future work.
Closes cloudtrainerwork#7
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gymwas missing fromrequirements.txt, but the RL environment layer imports it directly:src/environments/base.py:import gym,from gym import spacessrc/environments/options_env.py:import gym,from gym import spacessrc/training/position_manager_trainer.py:import gymThe result was
ModuleNotFoundError: No module named 'gym', so the entire environments subsystem failed to import and all 8 test modules undertests/environments/errored at collection.Closes #7.
Change
Add
gym>=0.26.2torequirements.txt.Testing
On Python 3.13:
The codebase only uses
gym.spaces, which functions correctly even though gym is unmaintained.Note on gym vs gymnasium
gymis unmaintained and prints a deprecation notice (it does not support the full NumPy 2.0 surface). The maintained drop-in successor isgymnasium. This PR deliberately keeps scope to the one-line dependency fix that matches the currentimport gymstatements; migrating togymnasium(which also changesstep/resetreturn signatures) is a larger, separate change and is noted inline inrequirements.txtas future work.🤖 Generated with Claude Code