Due to breaking changes released in the introduction of gymnasium
, I have taken a similar route to continue support and avoid confusion, hereby moving all future code maintenance to a newly named repository. See renderlab
for details.
apt-get install -y xvfb python-opengl ffmpeg > /dev/null 2>&1
pip install -U colabgymrender
pip install imageio==2.4.1
pip install --upgrade AutoROM
AutoROM --accept-license
pip install gym[atari,accept-rom-license]
import gym
from colabgymrender.recorder import Recorder
env = gym.make("Breakout-v0")
directory = './video'
env = Recorder(env, directory)
observation = env.reset()
terminal = False
while not terminal:
action = env.action_space.sample()
observation, reward, terminal, info = env.step(action)
env.play()