无法加载 gridworld-v0 环境

Cannot load gridworld-v0 environment

我正在尝试在 gridworld 环境中执行强化学习算法,但我找不到加载它的方法。

我已经成功安装了 gym 和 gridworld 0.14.0 然后我执行了这个命令

env = gym.make("gridworld-v0")

然后得到如下错误堆栈

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~/anaconda3/lib/python3.7/site-packages/gym/envs/registration.py in spec(self, path)
    131         try:
--> 132             return self.env_specs[id]
    133         except KeyError:

KeyError: 'gridworld-v0'

During handling of the above exception, another exception occurred:

UnregisteredEnv                           Traceback (most recent call last)
<ipython-input-36-b3991c5b334f> in <module>
----> 1 env = gym.make("gridworld-v0")
      2 env.setPlan("gridworldPlans/plan1.txt", {0: -0.001, 3: 1, 4: 1, 5: -1, 6: -1})
      3 statedic, mdp = env.getMDP()

~/anaconda3/lib/python3.7/site-packages/gym/envs/registration.py in make(id, **kwargs)
    154 
    155 def make(id, **kwargs):
--> 156     return registry.make(id, **kwargs)
    157 
    158 def spec(id):

~/anaconda3/lib/python3.7/site-packages/gym/envs/registration.py in make(self, path, **kwargs)
     98         else:
     99             logger.info('Making new env: %s', path)
--> 100         spec = self.spec(path)
    101         env = spec.make(**kwargs)
    102         # We used to have people override _reset/_step rather than

~/anaconda3/lib/python3.7/site-packages/gym/envs/registration.py in spec(self, path)
    140                 raise error.DeprecatedEnv('Env {} not found (valid versions include {})'.format(id, matching_envs))
    141             else:
--> 142                 raise error.UnregisteredEnv('No registered env with id: {}'.format(id))
    143 
    144     def register(self, id, **kwargs):

UnregisteredEnv: No registered env with id: gridworld-v0

我希望它足以加载环境,但显然已经足够了。

你能告诉我如何进行吗?

干杯, 保罗

应该大写:

env = gym.make('Gridworld-v0')

进一步参考:https://pypi.org/project/gym-gridworlds/