为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

Smart猫小萌 2023-10-06 16:29:47
我正在尝试从Google Research Football Environment安装 python 模块 gfootball 。按照 Mac 网站上显示的安装说明进行操作(我使用的是 macOS High Sierra (10.13.6) 和 Xcode 9.4),我使用以下内容测试了设置:# test_gfootball.pyimport gfootball.env as football_envenv = 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.我还应该检查什么才能发现问题?
查看完整描述

1 回答

?
互换的青春

TA贡献1797条经验 获得超6个赞

似乎是某些 Conda 环境的已知问题:https ://github.com/google-research/football/issues/156


查看完整回答
反对 回复 2023-10-06
  • 1 回答
  • 0 关注
  • 107 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信