我需要帮助纠正这个错误,我一直在repl.it中遇到错误,这是错误,我将其分解为关键要素:
Traceback (most recent call last):
File "python", line 3, in <module>
File "/home/runner/.site-packages/universe/__init__.py", line 227
print yaml.dump(
^
SyntaxError: invalid syntax
这是我使用的代码(我在repl.it中创建了它):
import gym
import universe
env = gym.make('flashgames.CoasterRacer-V0')
observation_n = env.reset()
while True:
observation_n = [[('KeyEvent', 'ArrowUp', True)] for ob in observation_n]
observation_n, reward_n, done_n, info = env.step(action_n)
env.render()
你能帮我吗?
这是repl.it链接,将您的编辑内容放入changes.txt; https://repl.it/@32_bits_in_a_by/to-be-fixed
答案 0 :(得分:0)
该错误似乎表明universe
仅是Python 2。