Farama-Foundation/Minigrid

[Bug Report] Error when creating BabyAI environment

chang-github-00 opened this issue · 2 comments

Describe the bug
Can't create an environment from BabyAI.

Code example

import gymnasium
gymnasium.make("BabyAI-GoToRedBall-v0")

got error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/v-changma1/miniconda3/envs/agent/lib/python3.9/site-packages/gymnasium/core.py", line 469, in __repr__
    return str(self)
  File "/home/v-changma1/miniconda3/envs/agent/lib/python3.9/site-packages/gymnasium/core.py", line 465, in __str__
    return f"<{type(self).__name__}{self.env}>"
  File "/home/v-changma1/miniconda3/envs/agent/lib/python3.9/site-packages/gymnasium/core.py", line 465, in __str__
    return f"<{type(self).__name__}{self.env}>"
  File "/home/v-changma1/miniconda3/envs/agent/lib/python3.9/site-packages/minigrid/minigrid_env.py", line 201, in __str__
    if i == self.agent_pos[0] and j == self.agent_pos[1]:
TypeError: 'NoneType' object is not subscriptable

System Info
Describe the characteristic of your environment:
pip install minigrid==2.3.0

  • What OS/version of Linux you're using. Note that while we will accept PRs to improve Window's support, we do not officially support it: Ubuntu 20.04
  • Python version: 3.9

Checklist

  • I have checked that there is no similar issue in the repo (required)

Can you check if you run env = gymnasium.make("BabyAI-GoToRedBall-v0") does it still produce the same error?

This error is somewhat fixed in #389, we'll ultimately fix it in the next major release. Before #389 is merged, please run env = gymnasium.make("BabyAI-GoToRedBall-v0") instead of just gymnasium.make("BabyAI-GoToRedBall-v0").

Thanks, this could be solved with env = gymnasium.make("BabyAI-GoToRedBall-v0")