openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.47k stars 8.59k forks source link

Env.close() not working with gym.make("CartPole-v1",render_mode="human") #3189

Open ras1292 opened 1 year ago

ras1292 commented 1 year ago

If you are submitting a bug report, please fill in the following details and use the tag [bug].

Describe the bug Testing code with CartPole-v1 when i render the object in Human mode the window will not close without resetting the kernel.

Code example import gymnasium as gym env = gym.make("CartPole-v1",render_mode="human")

observation, info = env.reset(seed=42) for _ in range(1000): action = env.action_space.sample() observation, reward, terminated, truncated, info = env.step(action)

if terminated or truncated:
    observation, info = env.reset()

env.close()

System Info Describe the characteristic of your environment:

Additional context Add any other context about the problem here.

Checklist

pseudo-rnd-thoughts commented 1 year ago

Yes, this is an known issue with jupyter notebooks on mac.