【发布时间】:2020-05-18 03:46:44
【问题描述】:
import sys
import pygame
def run_game():
pygame.init()
screen=pygame.display.set_mode((1200,800))
pygame.display.set_caption("Space Battle")
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
pygame.display.flip()
run_game()
我收到此错误:
Traceback(最近一次调用最后一次):
文件“C:/Users/Dell/PycharmProjects/test/test.py”,第 3 行,在
导入 pygame
ModuleNotFoundError:没有名为“pygame”的模块
我已经安装了 pygame 并在 windows 上的 cmd 上执行了导入命令。
我该如何解决这个问题?
【问题讨论】:
标签: python python-3.x import pygame