HTTP/2 308
date: Sun, 28 Dec 2025 08:39:36 GMT
content-length: 0
location: https://gymlibrary.dev/
x-azure-ref: 20251228T083936Z-r1d5f7d76657vhmmhC1BOM64yc00000015a0000000001yum
x-cache: CONFIG_NOCACHE
HTTP/2 301
server: GitHub.com
content-type: text/html
location: https://www.gymlibrary.dev/
x-github-request-id: D7B5:328FD3:76D9C3:85254A:6950EBAA
accept-ranges: bytes
age: 286
date: Sun, 28 Dec 2025 08:39:37 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210047-BOM
x-cache: HIT
x-cache-hits: 0
x-timer: S1766911177.006515,VS0,VE1
vary: Accept-Encoding
x-fastly-request-id: 15cc80b1e2e2c6b3f5f6519e0223e4cab5953ddc
content-length: 162
HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Sun, 29 Jun 2025 13:22:16 GMT
access-control-allow-origin: *
etag: W/"68613e08-8569"
expires: Sat, 27 Dec 2025 23:25:37 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: 6EA4:1F53DD:71094B:7E5B84:69506899
accept-ranges: bytes
age: 0
date: Sun, 28 Dec 2025 08:39:37 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210095-BOM
x-cache: HIT
x-cache-hits: 0
x-timer: S1766911177.108056,VS0,VE199
vary: Accept-Encoding
x-fastly-request-id: c93f2a7eac798e1c1700c1d5d7f43319db43f56d
content-length: 7405
Gym Documentation
Contents
Expand
Light mode
Dark mode
Auto light/dark, in light mode
Auto light/dark, in dark mode
Hide table of contents sidebar
Back to top
Toggle Light / Dark / Auto color theme
Toggle table of contents sidebar
Gym is a standard API for reinforcement learning, and a diverse collection of reference environments
The Gym interface is simple, pythonic, and capable of representing general RL problems:
import gym
env = gym . make ( "LunarLander-v2" , render_mode = "human" )
observation , info = env . reset ( seed = 42 )
for _ in range ( 1000 ):
action = policy ( observation ) # User-defined policy function
observation , reward , terminated , truncated , info = env . step ( action )
if terminated or truncated :
observation , info = env . reset ()
env . close ()
Gym Documentation
Gym has been unmaintained since 2022, and amongst other critical missing functionality does not support Numpy 2.0, and the documentation website has been taken offline.
Gymnasium is the maintained drop in replacement for Gym from the original Gym team if you're on the latest version of Gym.
Please upgrade your software to use Gymnasium, or contact the authors of your software and request that they upgrade.
You can read a migration guide for upgrading older version of Gym to Gymnasium here .
Click the button to continue to the Gymnasium documentation website.
Go to Gymnasium website