You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just installed this repo with pip install minigrid. Using python 3.10.9 on Win 11.
import gymnasium
gymnasium.make('MiniGrid-Unlock-v0')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gymnasium\core.py", line 383, in __repr__
return str(self)
File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gymnasium\core.py", line 379, in __str__
return f"<{type(self).__name__}{self.env}>"
File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\gymnasium\core.py", line 379, in __str__
return f"<{type(self).__name__}{self.env}>"
File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\minigrid\minigrid_env.py", line 207, in __str__
if i == self.agent_pos[0] and j == self.agent_pos[1]:
TypeError: 'NoneType' object is not subscriptable
This happens with any env I tried except the empty minigrid.
I have checked that there is no similar issue in the repo.
The text was updated successfully, but these errors were encountered:
You don't have it in your example code but I think you are printing the environment.
Minigrid implements a different print function than gym where the print actually provides a string-based grid of the current environment.
Therefore, you should be able to solve this through just avoiding the print statement until you have reset the environment.
We should be able to raise a more helpful error so thanks for the issue
Oh right! This is the first time I use the new minigrid + gymnasium, and in the old gym_minigrid the env was just printed as a matrix of strings without problems. Anyway, I can run experiments and that's what matters. Thanks!
Just installed this repo with
pip install minigrid
. Using python 3.10.9 on Win 11.This happens with any env I tried except the empty minigrid.
I have checked that there is no similar issue in the repo.
The text was updated successfully, but these errors were encountered: