= Farama Gymnasium
{c}
https://github.com/Farama-Foundation/Gymnasium
<OpenAI Gym>
gymnasium==1.1.1 just worked on <Ubuntu 24.10>:
``
sudo apt install swig
``
then from a <virtualenv>:
``
pip install "gymnasium[all]"
``
then the hello world:
``
import gymnasium as gym
env = gym.make("LunarLander-v3", render_mode="human")
observation, info = env.reset()
episode_over = False
while not episode_over:
action = env.action_space.sample()
observation, reward, terminated, truncated, info = env.step(action)
episode_over = terminated or truncated
env.close()
``
just works and opens a game window.
\Video[https://web.archive.org/web/20250225114240im_/https://gymnasium.farama.org/_images/lunar_lander.gif]
{title=Lunar Lander environemnt of <Farama Gymnasium>}
To actually play the games manually with keyboard, you need to define your own keybindings. Feature request for default keybindings: https://github.com/Farama-Foundation/Gymnasium/discussions/1330
There is no <C> API, you have to go through <Python>: https://github.com/Farama-Foundation/Gymnasium/discussions/1181[]. Shame.
Back to article page