#learning #rl #ml #gym


Gym Interface for Reinforcement Learning

1 unstable release

0.1.0 Apr 1, 2021

#584 in Science

Download history 43/week @ 2023-08-12 24/week @ 2023-08-19 17/week @ 2023-08-26 36/week @ 2023-09-02 18/week @ 2023-09-09 81/week @ 2023-09-16 13/week @ 2023-09-23 23/week @ 2023-09-30 16/week @ 2023-10-07 17/week @ 2023-10-14 15/week @ 2023-10-21 16/week @ 2023-10-28 18/week @ 2023-11-04 18/week @ 2023-11-11 21/week @ 2023-11-18 22/week @ 2023-11-25

79 downloads per month
Used in 4 crates (3 directly)

MIT license

83 lines


A collection of RL envs and interfaces.

  • Does not bind to Python like other RL crates. You can run faster and parallel computations.
  • Provides an unified interface to various envs. Verify your algorithm on classic envs and apply to your domain without code change.

Example of running envs in separate threads without vectorized envs:

Crates Role
gyms main crate including all sub-crates
gym-core provides GymEnv, ContinuousEnv, DiscreteEnv, etc
atari-env ALE envs
openspiel-env (TODO) OpenSpiel envs
retro-env (TODO) libretro envs
deepmind-lab-env (TODO) DeepMind Lab envs

Unrelated crates: gym, gym-rs


cargo run --example pong
cargo run --example pongpong
cargo run --example gym (requires the environmental variable `ATARI_ROMS_DIR`)
cargo run --example ppo (WIP)

Feature gates

Crates Default Available
gyms atari openspiel
atari-env sdl

Example: gyms = {version = "*", features = ["atari", "openspiel", "atari_env/sdl"]}


The easiest way to obtain ALE-compatible ROMs is pip install atari-py. You will have ROM files in ~/.local/lib/python3.x/site-packages/atari_py/atari_roms/.


Crates License
gyms MIT
gym-core MIT
atari-env GPL v2
atari-env-sys GPL v2
openspiel-env MIT
retro-env MIT
deepmind-lab-env GPL v2


~45K SLoC