gym icon indicating copy to clipboard operation
gym copied to clipboard

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

Open ras1292 opened this issue 1 year ago • 1 comments

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:

  • installsed using Pip
  • MACOS 13..0
  • Python 3.9.16

Additional context Add any other context about the problem here.

Checklist

  • [ X] I have checked that there is no similar issue in the repo (required)

ras1292 avatar Mar 01 '23 19:03 ras1292

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

pseudo-rnd-thoughts avatar Mar 01 '23 23:03 pseudo-rnd-thoughts