我正在使用Python 3.5.3和Debian 9
我试图从Universe的博客中运行以下示例代码:
import gym
import universe
env = gym.make('flashgames.DuskDrive-v0') #problem here
env.configure(remotes=1)
observation_n = env.reset()
while True:
action_n = [[('KeyEvent', 'ArrowUp', True)] for ob in observation_n]
observation_n, reward_n, done_n, info = env.step(action_n)
env.render()
我得到了这个错误:
WARN: Environment '<class 'universe.wrappers.timer.Timer'>' has deprecated methods '_step' and '_reset' rather than 'step' and 'reset'. Compatibility code invoked. Set _gym_disable_underscore_compat = True to disable this behavior.
Traceback (most recent call last):
File "universe_test.py", line 4, in <module>
env = gym.make('flashgames.DuskDrive-v0')
File "/home/user/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 167, in make
return registry.make(id)
File "/home/user/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 125, in make
patch_deprecated_methods(env)
File "/home/user/.local/lib/python3.5/site-packages/gym/envs/registration.py", line 185, in patch_deprecated_methods
env.seed = env._seed
AttributeError: 'Timer' object has no attribute '_seed'
我还发现了this个问题,该问题问的是同一问题,但未得到回答。
你们能帮我解决这个问题并运行程序吗?