Hi i just started learning pygame and i was trying to run a simple block of code but an error keeps popping up:

import pygame
from pygame.locals import *
screen = pygame.display.set_mode((640, 400))

when on running i get this error :

module 'pygame' from 'C:/Python27/Files\pygame.pyc'>
Traceback (most recent call last):
  File "C:/Python27/Files/tries", line 2, in <module>
    from pygame.locals import *
ImportError: No module named locals

i have the python 2.7.3 ver and pygame-1.9.1.win32-py2.7.
please let me know cause being stuck at a simple code block is frustrating me

Do not save any of your Pygame files wih the filename Pygame.py
Python will look in your working folder first and confuse it with the the Pygame package, usually located at
C:\Python27\Lib\site-packages\pygame

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.