0

当我从教程中使用它时。

import pygame

pygame.init()


black    = (   0,   0,   0)
white    = ( 255, 255, 255)
green    = (   0, 255,   0)
red      = ( 255,   0,   0)


size=[700,500]
screen=pygame.display.set_mode(size)

pygame.display.set_caption("jons cool game")

我收到此错误:

Traceback (most recent call last):
  File "C:\Users\Jonathan\Desktop\Pygame\Example.py", line 2, in <module>
    import pygame
ImportError: No module named 'pygame'

我正在使用 v3.3.1 和 pygame 3.3。

4

2 回答 2

3

根据ImportError您没有使用 Python 3.3 安装 pygame。

在 pygame 的网站上没有3.3 version. 我建议使用 Python 3.2 并从pygame.org下载相应的 pygame 版本

于 2013-04-18T18:17:58.193 回答
1

可能是您的 pygame 安装有问题。检查网站上的文档和教程以确保正确设置。

于 2013-04-18T18:15:18.757 回答