Answers.Body: <p>As you correctly pointed out, OpenAI Gym is less supported these days. It makes sense to go with Gymnasium, which is by the way developed by a non-profit organization.</p>
  <p>Regarding backwards compatibility, both Gym starting with version 0.26 and Gymnasium have changed the environment interface slightly (namely reset behavior and also <code>truncated</code> in addition to <code>done</code> in <code>def step</code> function). However, there exist adapters so that old environments can work with new interface too.</p>
  <p>Finally, you will also notice that commonly used libraries such as Stable Baselines3 and RLlib have switched to Gymnasium. Therefore, using Gymnasium will actually make your life easier.</p>
  <p>The only remaining bit is that old documentation may still use Gym in examples. Don't be confused and replace <code>import gym</code> with <code>import gymnasium as gym</code>. Even if there might be some small issues, I am sure you will be able to fix them.</p>
  <blockquote>
  <p>So my question is this: if I really want to try a wide variety of existing model architectures, does it make more sense to build my environment with Gym since so many implementations still support it, build it in Gymnasium, or does it not really matter because of wrappers/ etc?</p>
  </blockquote>
  <p>It does not really matter and I believe that Gymnasium is the most reasonable way to design your environment these days.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-15T17:52:11.960Z
Answers.Text: Thanks a ton, I’ll definitely do Gymansium then!
Answers.UserDisplayName: Justin T
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-14T18:58:39.690Z
Answers.LastActivityDate: 2023-08-14T19:04:01.350Z
Answers.LastEditDate: 2023-08-14T19:04:01.350Z
Answers.UserDisplayName: penkovsky
Body: <p>For context, I am looking to make my own custom Gym environment because I am more interested in trying a bunch of different architectures on this one problem than I am in seeing how a given model works in many environments. I am new to RL, and I'm seeing some confusing information about what is going on with Gym and Gymnasium. It sounds like from what I've looked at that gym is being deprecated, and it's important to me that this environment works for future models, but it also sounds like not a lot of model structures out there have been updated to reflect this new change to Gymnasium according to Gymnasium's own documentation, but the same documentation left me a little confused on how backward compatible Gymnasium is.</p>
  <p>So my question is this: if I really want to try a wide variety of existing model architectures, does it make more sense to build my environment with Gym since so many implementations still support it, build it in Gymnasium, or does it not really matter because of wrappers/ etc?</p>
  
Tags: <reinforcement-learning><environment><gym>
Title: Should I make my environment with gym or gymnasium?
UserDisplayName: Justin T
ThreadText: # Should I make my environment with gym or gymnasium?
  
  (Asked by: username_0 on 2023-08-14)
  
  For context, I am looking to make my own custom Gym environment because I am more interested in trying a bunch of different architectures on this one problem than I am in seeing how a given model works in many environments. I am new to RL, and I'm seeing some confusing information about what is going on with Gym and Gymnasium. It sounds like from what I've looked at that gym is being deprecated, and it's important to me that this environment works for future models, but it also sounds like not a lot of model structures out there have been updated to reflect this new change to Gymnasium according to Gymnasium's own documentation, but the same documentation left me a little confused on how backward compatible Gymnasium is.
  
  So my question is this: if I really want to try a wide variety of existing model architectures, does it make more sense to build my environment with Gym since so many implementations still support it, build it in Gymnasium, or does it not really matter because of wrappers/ etc?
  
  **Tags:** reinforcement-learning, environment, gym
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-08-14. Score: 3 | Accepted answer
  
  As you correctly pointed out, OpenAI Gym is less supported these days. It makes sense to go with Gymnasium, which is by the way developed by a non-profit organization.
  
  Regarding backwards compatibility, both Gym starting with version 0.26 and Gymnasium have changed the environment interface slightly (namely reset behavior and also `truncated` in addition to `done` in `def step` function). However, there exist adapters so that old environments can work with new interface too.
  
  Finally, you will also notice that commonly used libraries such as Stable Baselines3 and RLlib have switched to Gymnasium. Therefore, using Gymnasium will actually make your life easier.
  
  The only remaining bit is that old documentation may still use Gym in examples. Don't be confused and replace `import gym` with `import gymnasium as gym`. Even if there might be some small issues, I am sure you will be able to fix them.
  
  > So my question is this: if I really want to try a wide variety of existing model architectures, does it make more sense to build my environment with Gym since so many implementations still support it, build it in Gymnasium, or does it not really matter because of wrappers/ etc?
  
  It does not really matter and I believe that Gymnasium is the most reasonable way to design your environment these days.
  
  > **Comments:**
  > **username_0**: Thanks a ton, I’ll definitely do Gymansium then!  
  
  ---
  
  