Skip to content

fix(deps): add missing gym dependency for RL environments (#7)#23

Open
bradsmithmba wants to merge 1 commit into
cloudtrainerwork:masterfrom
bradsmithmba:fix/add-gym-dependency
Open

fix(deps): add missing gym dependency for RL environments (#7)#23
bradsmithmba wants to merge 1 commit into
cloudtrainerwork:masterfrom
bradsmithmba:fix/add-gym-dependency

Conversation

@bradsmithmba

Copy link
Copy Markdown

Summary

gym was missing from requirements.txt, but the RL environment layer imports it directly:

  • src/environments/base.py: import gym, from gym import spaces
  • src/environments/options_env.py: import gym, from gym import spaces
  • src/training/position_manager_trainer.py: import gym

The result was ModuleNotFoundError: No module named 'gym', so the entire environments subsystem failed to import and all 8 test modules under tests/environments/ errored at collection.

Closes #7.

Change

Add gym>=0.26.2 to requirements.txt.

Testing

On Python 3.13:

$ pytest tests/environments/ -q
131 passed

The codebase only uses gym.spaces, which functions correctly even though gym is unmaintained.

Note on gym vs gymnasium

gym is unmaintained and prints a deprecation notice (it does not support the full NumPy 2.0 surface). The maintained drop-in successor is gymnasium. This PR deliberately keeps scope to the one-line dependency fix that matches the current import gym statements; migrating to gymnasium (which also changes step/reset return signatures) is a larger, separate change and is noted inline in requirements.txt as future work.

🤖 Generated with Claude Code

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>
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.

gym missing from requirements.txt — entire RL/environments subsystem fails to import

1 participant