gym
gym copied to clipboard
Env.close() not working with gym.make("CartPole-v1",render_mode="human")
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)
Yes, this is an known issue with jupyter notebooks on mac.