Gym: AttributeError: module 'gym.envs.box2d' has no attribute 'LunarLander'

Created on 4 Apr 2019  路  1Comment  路  Source: openai/gym

System: Ubuntu 18 LTS subsystem of Windows 10

After pip installed gym, I opened python and tried to load LunarLander-v2.

I got the following message:

>>> gym.make("LunarLander-v2")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/victor/anaconda3/envs/yy/lib/python3.6/site-packages/gym/envs/registration.py", line 183, in make
    return registry.make(id, **kwargs)
  File "/home/victor/anaconda3/envs/yy/lib/python3.6/site-packages/gym/envs/registration.py", line 125, in make
    env = spec.make(**kwargs)
  File "/home/victor/anaconda3/envs/yy/lib/python3.6/site-packages/gym/envs/registration.py", line 88, in make
    cls = load(self._entry_point)
  File "/home/victor/anaconda3/envs/yy/lib/python3.6/site-packages/gym/envs/registration.py", line 18, in load
    fn = getattr(mod, attr_name)
AttributeError: module 'gym.envs.box2d' has no attribute 'LunarLander'

No immediate solution to this. I have tried to install from cloned git, or pip install it in a clean virtual machine. Neither seems to solve this issue.

Most helpful comment

Solved.

It's not gym's problem. It stems from failure to install pybox2d.

Please refer to here:
https://stackoverflow.com/questions/44198228/install-pybox2d-for-python-3-6-with-conda-4-3-21

>All comments

Solved.

It's not gym's problem. It stems from failure to install pybox2d.

Please refer to here:
https://stackoverflow.com/questions/44198228/install-pybox2d-for-python-3-6-with-conda-4-3-21

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhan0903 picture zhan0903  路  4Comments

pickittwice picture pickittwice  路  4Comments

mdavis-xyz picture mdavis-xyz  路  3Comments

hipoglucido picture hipoglucido  路  4Comments

reaIws picture reaIws  路  4Comments