运行 Python 模块 gfootball 时出现错误消息

我正在尝试从Google Research Football Environment安装 python 模块 gfootball 。按照 Mac 网站上显示的安装说明进行操作(我使用的是 macOS High Sierra (10.13.6) 和 Xcode 9.4),我使用以下内容测试了设置:

# test_gfootball.py


import gfootball.env as football_env


env = football_env.create_environment(env_name="academy_empty_goal_close")


env.reset()


env.close()


但我收到以下错误:


File "test_gfootball.py", line 5, in <module>

    env = football_env.create_environment(env_name="academy_empty_goal_close")

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gfootball/env/__init__.py", line 182, in create_environment

    scenario_config = config.Config({'level': env_name}).ScenarioConfig()

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gfootball/env/config.py", line 98, in __init__

    self.NewScenario()

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gfootball/env/config.py", line 153, in NewScenario

    self._scenario_cfg = scenario_builder.Scenario(self).ScenarioConfig()

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gfootball/env/scenario_builder.py", line 62, in __init__

    scenario.build_scenario(self)

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gfootball/scenarios/academy_empty_goal_close.py", line 33, in build_scenario

    builder.AddPlayer(-1.0, 0.0, e_PlayerRole_GK)

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gfootball/env/scenario_builder.py", line 108, in AddPlayer

    player = Player(x, y, role, lazy, controllable)

TypeError: __init__() should return None, not 'NoneType'


我已经处理了错误消息中指定的文件,但据我所知,一切似乎都很好。我怀疑使用“env_name”的调用有问题 - 也许它找不到场景 - “academy_empty_goal_close.


我还应该检查什么才能发现问题?


Smart猫小萌
浏览 108回答 1
1回答

互换的青春

似乎是某些 Conda 环境的已知问题:https ://github.com/google-research/football/issues/156
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python