Closed freyavs closed 1 year ago
Could you try
import gym
import gym_miniworld
print(gym.envs.registry.keys())
env = gym.make("MiniWorld-CollectHealth-v0")
On a fresh install, gym contains the environment for me but raises an error related to pyglet instead of NameNotFound
This is the result:
For comparison, I'm trying the exact same with a similar project (memory maze), and there it does show the registered environments in this print. Also did a fresh install and still the same.
Edit: actually, with pip install and then import miniworld
I'm not getting this error anymore, might be something with installing from source. But I am getting another error where /site-packages/miniworld/meshes/medkit.obj
doesn't exist, not sure if this is because of broken pip install mentioned "You can install it from PyPI using (image broken do not use yet)".
With installing via pip, I run into another problem. For running on a cluster, setting the PYOPENGL_PLATFORM environment does not seem to be working? (the alternative solution mentioned is not relevant for me)
PYOPENGL_PLATFORM=egl python3 your_script.py
I also tried this locally, and get the same error (in pyglet)
ValueError: Unknown OpenGL API: None
(running locally without setting this variable also gives an error because there's no /site-packages/miniworld/meshes/..
)
@BolunDai0216 Would you be able to help with this?
For your original problem (if installed from source), I think it is because we are currently moving to use gymnasium
instead of gym
.
Can you try
import gymnasium as gym
import gym_miniworld
env = gym.make("MiniWorld-CollectHealth-v0")
and see if that works?
If that still does not solve your issue, can you try running manual_control.py
in the scripts
directory and see if that is working?
That solved most of the problems, thank you! I'm still seeing the ValueError: Unknown OpenGL API: None
on my cluster, but I assume for pyglet to work the underlying OpenGL drivers etc. should be set up?
Yes, I think OpenGL should be set up.
Hi, I'm not sure if this is a bug or if I'm doing something wrong, but I'm trying to use this project with the gym interface. I'm getting the following error
gym.error.NameNotFound: Environment MiniWorld-CollectHealth doesn't exist.
Code example
System Info
Additional context I did some logging, the environments get registered and are in the registry immediately afterwards. But then later, when calling
gym.make
, they are not in the registry anymore:I've tried the exact same workflow on a similar project, where it does work. So, not sure if this is a bug or what else to do here?