【发布时间】:2017-05-13 15:38:37
【问题描述】:
我正在使用python 和pygame 创建一个塔防游戏。我想将这个添加到 Google Play 商店,但我需要创建一个 apk 文件。
我正在关注 GitHub 上的教程:
https://github.com/renpytom/rapt-pygame-example。
我按照所有说明进行操作,但无法安装 pygame_sdl2。
我使用命令提示符,并在相应目录中使用$ python setup.py install。
但它给了我这个错误:
C:\Users\gomes\Downloads\pygame_sdl2-master>python setup.py install
Traceback (most recent call last):
File "setup.py", line 59, in <module>
parse_cflags([ "sh", "-c", "sdl2-config --cflags" ])
File "C:\Users\gomes\Downloads\pygame_sdl2-master\setuplib.py", line 93, in parse_cflags
output = subprocess.check_output(command, universal_newlines=True)
File "C:\Python27\lib\subprocess.py", line 212, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "C:\Python27\lib\subprocess.py", line 390, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
startupinfo)
WindowsError: [Error 2] Le fichier spÚcifiÚ est introuvable
我尝试重新安装pygame_sdl2-master,但结果相同。
【问题讨论】:
-
Bienvenue sur Stack Overflow! Veuillez excluder mon franc,ais :-)
setup.py,在第 59 行,尝试运行 Windows 上没有的 shell。我想知道为什么该行后面的“except”不处理该异常 - 如果您从第 63-64 行删除if not windows: raise会发生什么?
标签: python pygame apk python python-2.7 pygame sdl-2