baba-is-auto
baba-is-auto copied to clipboard
Python error AssertionError: Observation space ... does not inherit from gym.spaces.Space
(dev) [nickp@m1 baba-babaisyou-v0 (main)]$ python3 DQN.py
Traceback (most recent call last):
File "DQN.py", line 16, in <module>
env = gym.make('baba-babaisyou-v0')
File "/Users/nickp/opt/anaconda3/envs/dev/lib/python3.7/site-packages/gym/envs/registration.py", line 601, in make
env = PassiveEnvChecker(env)
File "/Users/nickp/opt/anaconda3/envs/dev/lib/python3.7/site-packages/gym/wrappers/env_checker.py", line 25, in __init__
check_observation_space(env.action_space)
File "/Users/nickp/opt/anaconda3/envs/dev/lib/python3.7/site-packages/gym/utils/passive_env_checker.py", line 145, in check_observation_space
f"Observation space ({observation_space}) does not inherit from gym.spaces.Space"
AssertionError: Observation space ([<Direction.UP: 1>, <Direction.DOWN: 2>, <Direction.LEFT: 3>, <Direction.RIGHT: 4>]) does not inherit from gym.spaces.Space
Python 3.7.10
gym.__version__ = '0.24.1'
Thanks for report! I'll check it tonight. 😉
Hi, I ran into the same issue and I believe it is due to gym being updated to a later version which is more strict regarding the creation of custom environments. Running the code on gym version 0.21.0 works for me.
does anyone know how to update the code to match the lateest version?