[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

RE: [pygame] Installing Pygame



I've figured out the problem. I was trying to run the program using Python 3.3 but Pygame was installed in my Python 3.2 folder. Deleted 3.3 and ran the program using 3.2.



From: mylesbroomes@xxxxxxxxxxxxx
To: pygame-users@xxxxxxxx
Subject: [pygame] Installing Pygame
Date: Tue, 28 Jan 2014 19:11:11 +0000

I am trying to import pygame but everytime I do, I get an ImportError. Here is the code I'm trying to run:

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()

And the error I get:

Traceback (most recent call last):
  File "C:\Python32\blankgame.py", line 1, in <module>
    import pygame,sys
ImportError: No module named 'pygame'

When I import pygame using the shell however, it works fine. I am using Python 3.2.3 and the Pygame installer I downloaded is
pygame-1.9.2a0.win32-py3.2.msi.