【发布时间】:2017-10-20 04:15:57
【问题描述】:
我已经安装了 pygame 和 numpy 并且似乎都在 win10 上工作 来自 python 外壳:
import pygame
(工作)
输入脚本:
import pygame, sys
from pygame.locals import *
pygame.init()
DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')
while True: # main game loop
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
pygame.display.update()
Pygame 窗口打开,python 停止。在我退出 python 之前,在 python shell 中说“没有名为 pygame 的模块”
【问题讨论】:
-
您是否检查过您的 shell 使用的 python 版本,与您的系统默认使用的 python 版本相比?
标签: python-3.x pygame