我已经使用 pip install 安装了 box2d,但是当我使用 python 为 box2d 游戏运行 OpenAI 健身房环境时。就我而言,我正在尝试运行 LunarLander 环境:-
import gym
env = gym.make("LunarLander-v2")
env.reset()
我收到此错误:
[2018-01-02 01:37:39,026] Making new env: LunarLander-v2
Traceback (most recent call last):
File "ens.py", line 13, in <module>env = gym.make(a)
File "/home/yograj/gym/gym/envs/registration.py", line 164, in make
return registry.make(id)
File "/home/yograj/gym/gym/envs/registration.py", line 122, in make
env = spec.make()
File "/home/yograj/gym/gym/envs/registration.py", line 88, in make cls
= load(self._entry_point)
File "/home/yograj/gym/gym/envs/registration.py", line 17, in load
result = entry_point.load(False)
File "/home/yograj/anaconda2/lib/python2.7/site-packages/setuptools-
27.2.0-py2.7.egg/pkg_resources/__init__.py", line 2258, in load
File "/home/yograj/anaconda2/lib/python2.7/site-packages/setuptools-
27.2.0-py2.7.egg/pkg_resources/__init__.py", line 2264, in resolve
File "/home/yograj/gym/gym/envs/box2d/__init__.py", line 1, in
<module>from gym.envs.box2d.lunar_lander import LunarLander
File "/home/yograj/gym/gym/envs/box2d/lunar_lander.py", line 4, in
<module> import Box2D File "/home/yograj/anaconda2/lib/python2.7/site
packages/Box2D/__init__.py", line 20, in <module>from .Box2D import *
File
"/home/yograj/anaconda2/lib/python2.7/sitepackages/Box2D/Box2D.py",
line 434, in <module> RAND_LIMIT = _Box2D.RAND_LIMIT
AttributeError: 'module' object has no attribute 'RAND_LIMIT'