[BUG] minihack.scripts.play don't work on Debian 11
Closed this issue ยท 3 comments
๐ Bug
After installing minihack+nle to Debian 11 the following commands work:
import gym
import minihack
env = gym.make("MiniHack-River-v0")
env.reset() # each reset generates a new environment instance
env.step(1) # move agent '@' north
env.render()
But when running
python3 -m minihack.scripts.play --env MiniHack-River-v0
The program fails to errors.
To Reproduce
Steps to reproduce the behavior:
- Install Debian 11. Install minihack+nle (+deps) using pip install/apt-get commands.
- python3 -m minihack.scripts.play --env MiniHack-River-v0
Error messages/traceback:
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.9/dist-packages/minihack/scripts/play.py", line 334, in
main()
File "/usr/local/lib/python3.9/dist-packages/minihack/scripts/play.py", line 330, in main
play(**vars(flags))
File "/usr/local/lib/python3.9/dist-packages/minihack/scripts/play.py", line 123, in play
print("Available actions:", env._actions)
File "/home/optimus/.local/lib/python3.9/site-packages/gym/core.py", line 235, in getattr
raise AttributeError(
AttributeError: attempted to get missing private attribute '_actions'
Expected behavior
One should be able to play minihack using keyboard commands.
Environment
Collecting environment information...
MiniHack version: 0.1.1
NLE version: 0.7.3
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
OS: Debian GNU/Linux 11 (bullseye)
GCC version: (Debian 10.2.1-6) 10.2.1 20210110
CMake version: version 3.18.4
Python version: 3.9
Is CUDA available: N/A
CUDA runtime version: Could not collect
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Could not collect
Versions of relevant libraries:
[pip3] msgpack-numpy==0.4.7.1
[pip3] numpy==1.19.5
[conda] Could not collect
Additional context
No Anaconda installed.
I suspect this is related to the latest update of the gym library. The env object now gets wrapped automatically, which hides the _action attribute (which we really shouldn't be accessing like this anyway).
Hi @csrl. Could you please confirm your gym
version? The updated environment collection script will print this out for you.
MiniHack currently has support for Gym versions < 20. However, we will add support for the most recent versions of Gym very soon.