我刚开始使用 pygame,我遇到了一些问题,这是我的代码......
从 pygame.locals 导入 pygame, sys 导入 *
pygame.init()
DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
pygame.display.update()
这是我不断收到的错误...
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1521, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Jason\Documents\Python\pygame.… line 1, in <module>
import pygame, sys
File "C:\Users\Jason\Documents\Python\pygame.… line 2, in <module>
from pygame.locals import *
ImportError: No module named 'pygame.locals'; pygame is not a package
所以我的问题是我如何让 pygame 与 python 一起工作?python 3.3.2 pygame 版本:Python 3.3 pygame-1.9.2pre(64-bit)