Open AI gym render function not working(MACbook pro M1 max chip)

Viewed 26

Try to run the cartpole environment on my macbook pro and the render function cannot work as there shows no animation about the cart. However, the code seems to work and my DQN can train under the environment. Still no animation after trying some tips provided by stack overflow. Codes as below

import gym
env = gym.make('CartPole-v0')
env.reset()
for _ in range(1000):
    env.render()
    env.step(env.action_space.sample()) # take a random action
env.close()
0 Answers
Related