Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render() got an unexpected keyword argument 'close' #1056

Closed
roboserg opened this issue May 31, 2018 · 5 comments · Fixed by fspirit/reinforcement-learning#1 or dennybritz/reinforcement-learning#198

Comments

@roboserg
Copy link

Code: env.render(close=True)

Using windows 10 + anaconda + jupyter. Tried gym ver. 0.10.5 and 0.10.3

@kosii
Copy link
Contributor

kosii commented Jun 6, 2018

I believe close is now a top level method, try env.close() instead

@shuruiz
Copy link

shuruiz commented Jun 12, 2018

I tried env.render(close=True) on OSX and it reported the same error. You should use env.close() instead.

@roboserg
Copy link
Author

roboserg commented Jun 25, 2018

I dont need to close the environment with env.close(). Doing "env.render(close=True)" was allowing before to close the env window with a mouse by pressing on the 'X' icon of the window. Without close=True the windows freezes and you have to restart the kernel to fix it.

@christopherhesse
Copy link
Contributor

env.render() should return a bool indicating that the window is still open. Once this returns false, the caller to env.render() should exit. If this isn't true for some particular environment, a PR would be appreciated. close=True was removed some time ago I believe.

fspirit added a commit to fspirit/reinforcement-learning that referenced this issue Mar 29, 2019
It was crashing on my win10 PC, I found a fix openai/gym#1056 and applied it.
fspirit added a commit to fspirit/reinforcement-learning that referenced this issue Mar 29, 2019
It was crashing on my win10 PC, I found a fix openai/gym#1056 and applied it.
@Madhuparna04
Copy link

Updating gym works for me.
I used gym version 0.15.4.

Use
pip uninstall gym
pip install gym==0.15.4

bionicles added a commit to bionicles/gym-ple that referenced this issue Jun 26, 2020
most environments use env.close() to close the renderer, this makes it work like the others

mentioned by the maintainers of the gym here: openai/gym#1056
bionicles added a commit to bionicles/gym-minigrid that referenced this issue Jun 29, 2020
as mentioned here: openai/gym#1056 (comment) 

close=True was removed a while ago, so this change just adds an 'env.close' method exactly the same as the way you were doing it, without removing the old way, so it's hopefully backwards compatible (let's test it!)
bionicles added a commit to bionicles/vizdoomgym that referenced this issue Jun 29, 2020
this just helps to clean up the render windows and is standard as mentioned here openai/gym#1056 (comment)
bionicles added a commit to bionicles/slimevolleygym that referenced this issue Jun 29, 2020
this helps clean up the render windows as mentioned here openai/gym#1056 (comment)
maximecb pushed a commit to Farama-Foundation/Minigrid that referenced this issue Jun 29, 2020
as mentioned here: openai/gym#1056 (comment) 

close=True was removed a while ago, so this change just adds an 'env.close' method exactly the same as the way you were doing it, without removing the old way, so it's hopefully backwards compatible (let's test it!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants