Gym: render() got an unexpected keyword argument 'close'

Created on 31 May 2018  路  5Comments  路  Source: openai/gym

Code: env.render(close=True)

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

Most helpful comment

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.

All 5 comments

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

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

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.

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.

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

Use
pip uninstall gym
pip install gym==0.15.4

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ettrig picture Ettrig  路  3Comments

Spiral-Galaxy picture Spiral-Galaxy  路  3Comments

lbbc1117 picture lbbc1117  路  3Comments

pickittwice picture pickittwice  路  4Comments

RuofanKong picture RuofanKong  路  3Comments