“如何解决”pygame.error错误:无法设置控制台屏幕信息“

2024-04-23 06:13:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在linux中运行一段pygame代码,但出现了一个错误。你知道吗

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
  File "air_target.py", line 30, in <module>
    screen = pg.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))  # 初始化窗口
pygame.error: Couldn't set console screen info

我在Ubuntu 16.04.5 LTS中运行,python版本是3.5.2 GCC VERSION。 我搜索了错误代码,但没有找到是的。然后呢我看了看这个游戏。 我试图安装1.2.15版本的SDL来解决这个问题,但是失败了。你知道吗

hero_down_index = 3  # new

# init the game
screen = pg.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) 
...

windows中的代码运行正常。你知道吗


Tags: the代码版本hellomodelinux错误display