I've made the following instruction :

git clone https://github.com/JKCooper2/gym-bandits.git
cd gym-bandits
pip install -e .

After installing :

import gym_bandits
import gym

Now we finally :

env = gym.make("BanditTenArmedGaussian-v0")

Even tough the first three steps was successfull, the last one doesn't work. Here is my error :

KeyError                                  Traceback (most recent call last)
c:\windows\system32\gym\gym\envs\registration.py in spec(self, path)
    120         try:
--> 121             return self.env_specs[id]
    122         except KeyError:

KeyError: 'BanditTenArmedGaussian-v0'

During handling of the above exception, another exception occurred:

UnregisteredEnv                           Traceback (most recent call last)
<ipython-input-13-645d2b1dfa73> in <module>
      4 import math
      5 import random
----> 6 env = gym.make("BanditTenArmedGaussian-v0")

c:\windows\system32\gym\gym\envs\registration.py in make(id, **kwargs)
    144 def make(id, **kwargs):
--> 145     return registry.make(id, **kwargs)
    147 def spec(id):

c:\windows\system32\gym\gym\envs\registration.py in make(self, path, **kwargs)
     87         else:
     88             logger.info('Making new env: %s', path)
---> 89         spec = self.spec(path)
     90         env = spec.make(**kwargs)
     91         # We used to have people override _reset/_step rather than

c:\windows\system32\gym\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))
    133     def register(self, id, **kwargs):

UnregisteredEnv: No registered env with id: BanditTenArmedGaussian-v0

Does anyone know how to fix it ?

Thanks and regards.


The standard installation of OpenAI environments does not support Windows. See the GitHub issue here.

To get that code to run, you'll have to switch another operating system (i.e., Linux or Mac) or use a non-standard installation.

  • 1
    $\begingroup$ Or use google's Colab platform. Here is the link colab.research.google.com/drive/… $\endgroup$ May 26 '20 at 13:47
  • $\begingroup$ It works ! Thank you can you write it as an answer I'll give you +50. $\endgroup$
    – CechMS
    Jun 1 '20 at 6:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.