AttributeError: 'module' object has no attribute 'RAND_LIMIT'


I can’t run the LunarLander-v2 env. Please help me to solve this problem.

$ python
[2017-06-05 16:34:11,055] Making new env: LunarLander-v2
Traceback (most recent call last):
  File "", line 3, in <module>
    env = gym.make('LunarLander-v2')
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 161, in make
    return registry.make(id)
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 119, in make
    env = spec.make()
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 85, in make
    cls = load(self._entry_point)
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/", line 17, in load
    result = entry_point.load(False)
  File "/home/milad/.local/lib/python2.7/site-packages/pkg_resources/", line 2302, in load
    return self.resolve()
  File "/home/milad/.local/lib/python2.7/site-packages/pkg_resources/", line 2308, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/box2d/", line 1, in <module>
    from gym.envs.box2d.lunar_lander import LunarLander
  File "/usr/local/lib/python2.7/dist-packages/gym/envs/box2d/", line 4, in <module>
    import Box2D
  File "/usr/local/lib/python2.7/dist-packages/Box2D/", line 20, in <module>
    from .Box2D import *
  File "/usr/local/lib/python2.7/dist-packages/Box2D/", line 434, in <module>
AttributeError: 'module' object has no attribute 'RAND_LIMIT'


This forum is dead.


Did you ever figure this out? I’m having the same problem.