我正在尝试在运行Catalina10.15.7的苹果电脑上安装Google Football。和Xcode 12.0我已经按照网站上显示的说明使用Homebrew安装了所需的软件包,但当我尝试使用以下命令运行该软件时:
python3 -m gfootball.play_game --action_set=full我收到以下消息:
WARNING:root:Looks like game engine is not compiled, please run:
WARNING:root: pushd /usr/local/lib/python3.8/site-packages/gfootball_engine && cmake . && make -j `nproc` && popd
WARNING:root: pushd /usr/local/lib/python3.8/site-packages/gfootball_engine && ln -s libgame.so _gameplayfootball.so && popd
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py", line 111, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.8/site-packages/gfootball/__init__.py", line 17, in <module>
from gfootball.env import scenario_builder
File "/usr/local/lib/python3.8/site-packages/gfootball/env/__init__.py", line 21, in <module>
from gfootball.env import config
File "/usr/local/lib/python3.8/site-packages/gfootball/env/config.py", line 24, in <module>
import gfootball_engine as libgame
File "/usr/local/lib/python3.8/site-packages/gfootball_engine/__init__.py", line 39, in <module>
from _gameplayfootball import *
ImportError: dlopen(/usr/local/lib/python3.8/site-packages/gfootball_engine/_gameplayfootball.so, 2): no suitable image found. Did find:
/usr/local/lib/python3.8/site-packages/gfootball_engine/_gameplayfootball.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x03
/usr/local/lib/python3.8/site-packages/gfootball_engine/_gameplayfootball.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x03按照消息中显示的指导,我随后运行:
/usr/local/lib/python3.8/site-packages/gfootball_engine /usr/local/lib/python3.8/site-packages/gfootball_engine ~/Desktop
Using Python: 3.8.6
-- Could NOT find Boost: missing: python3-py38 (found /usr/local/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found version "1.73.0"))
python3-py38 not found. Trying other names.
-- Could NOT find Boost: missing: python-py38 (found /usr/local/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found version "1.73.0"))
python-py38 not found. Trying other names.
-- Found Boost: /usr/local/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found version "1.73.0") found components: python38
Using python_boost: python38
-- Found Boost: /usr/local/lib/cmake/Boost-1.73.0/BoostConfig.cmake (found version "1.73.0") found components: thread system filesystem python38
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/lib/python3.8/site-packages/gfootball_engine
zsh: command not found: nproc
[ 0%] Built target managerslib
[ 0%] Built target systemscommonlib
[ 2%] Built target loaderslib
[ 5%] Built target typeslib
[ 8%] Built target datalib
[ 14%] Built target utilslib
[ 20%] Built target menulib
[ 28%] Built target gui2lib
[ 40%] Built target baselib
[ 50%] Built target systemsgraphicslib
[ 62%] Built target scenelib
[ 64%] Built target blunted2
[ 88%] Built target gamelib
[100%] Built target game
/usr/local/lib/python3.8/site-packages/gfootball_engine ~/Desktop我已经检查了nproc是否已安装(使用pip3列表),但我不确定为什么找不到它。当我使用第二条警告消息中显示的建议时:
pushd /usr/local/lib/python3.8/site-packages/gfootball_engine && ln -s libgame.so _gameplayfootball.so && popd我得到以下消息:
/usr/local/lib/python3.8/site-packages/gfootball_engine /usr/local/lib/python3.8/site-packages/gfootball_engine /usr/local/lib/python3.8/site-packages/gfootball_engine ~/Desktop
ln: _gameplayfootball.so: File exists“文件存在”消息表明编译的游戏引擎在错误的文件夹中,但我不确定。我已经检查了文件夹的数量,一切似乎都已就绪,例如,我使用的是Homebrew文件夹中的python版本,例如python@3.8。
我是Python的新手,所以很可能我把自己弄得乱七八糟,编译和文件夹。感谢任何关于下一步如何解决这个问题的帮助-谢谢。