crapher / medium

Apache License 2.0
71 stars 45 forks source link

OpenAI Gymnasium instead of gym ? #4

Open tamstorf opened 8 months ago

tamstorf commented 8 months ago

@crapher

Hello Diego,

First of all thank you for creating a very nice learning environment ! I've started going through your Medium posts from the beginning, but I'm running into some problems with OpenAI's gym in sections 3, 4, and 5. When I run the code (using python3.11) I get :

./medium/venv/lib/python3.11/site-packages/stable_baselines3/common/vec_env/patch_gym.py:49: UserWarning: You provided an OpenAI Gym environment. We strongly recommend transitioning to Gymnasium environments. Stable-Baselines3 is automatically wrapping your environments in a compatibility layer, which could potentially cause issues.

And in fact it fails to run. I tried simply replacing "gym" with "gymnasium" in your code, but maybe that was a little too optimistic (it doesn't work either without further modifications). I suspect that this is all because I'm using different versions of the various packages than you used when you wrote the code. As such it could be helpful if you can include information somewhere about what python and package versions this has been tested with.

Rasmus