minerllabs / minerl

MineRL Competition for Sample Efficient Reinforcement Learning - Python Package
http://minerl.io/docs/
Other
676 stars 151 forks source link

UnregisteredEnv: No registered env with id: MineRLNavigateDense-v0 #586

Open Taitai6521 opened 3 years ago

Taitai6521 commented 3 years ago

`` env = gym.make('MineRLNavigateDense-v0')

obs = env.reset()

done = False while not done: action = env.action_space.sample()

# One can also take a no_op action with
# action =env.action_space.noop()

obs, reward, done, info = env.step(
    action)

When I tried this code, I got the above error. I could not figure it out by looking it up, so I would appreciate a cool answer.

`--------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/gym/envs/registration.py in spec(self, path) 120 try: --> 121 return self.env_specs[id] 122 except KeyError:

KeyError: 'MineRLNavigateDense-v0'

During handling of the above exception, another exception occurred:

UnregisteredEnv Traceback (most recent call last) 3 frames /usr/local/lib/python3.7/dist-packages/gym/envs/registration.py in spec(self, path) 129 raise error.DeprecatedEnv('Env {} not found (valid versions include {})'.format(id, matching_envs)) 130 else: --> 131 raise error.UnregisteredEnv('No registered env with id: {}'.format(id)) 132 133 def register(self, id, **kwargs):

UnregisteredEnv: No registered env with id: MineRLNavigateDense-v0`

Miffyli commented 3 years ago

Hmm for me things work fine with the up-to-date pypi version. Make sure you import minerl as well as gym before trying to create environments. If that fails, also try updating your MineRL with pip install --upgrade minerl.

Taitai6521 commented 2 years ago

Thanks.