在MacOSX上启动Pygame模块

2024-05-01 21:56:36 发布

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

我正在学习如何使用macosx(High Sierra)在Python3.5上使用pygame模块。我已经安装了模块,但每次启动显示时都会收到错误消息。示例:

import pygame
screen = pygame.display.set_mode((1000,1000)) #dimensions can be 
anything

(Error I get)
AttributeError: module 'MacOS' has no attribute 'WMAvailable'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/user1/Documents/pygamet/pygametest.py", line 3, in 
<module>
screen = pygame.display.set_mode((1000,1000))
SystemError: <built-in function set_mode> returned a result with an 
error set

无论我做什么(在它前面添加pygame.init()等等),错误都会持续存在

我知道pygame可能无法在python3.5上运行,但我以前见过它在我使用的同一型号计算机上运行。你知道吗


Tags: 模块in消息示例mode错误displayexception