![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 56
Rep Power: 3
![]() |
Pygame error
Hey, I downloaded pygame but when I try to import pygame in the python intepreter it gives me the following error:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in -toplevel-
import pygame
File "C:/Python24\pygame.py", line 2, in -toplevel-
from pygame.locals import *
ImportError: No module named localsCan someone help me with this prob ? Thanks in advance =) |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
Did you install Pygame? If so, there should be a folder called C:\Python24\Lib\site-packages\pygame on your computer. Pygame is a package, there is no file called pygame.py, just the folder pygame and a file __init__.py in the folder declaring the package. This folder also contains locals.py, the module file you are looking for.
If you have Windows you should have downloaded the installer pygame-1.7.1release.win32-py2.4.exe and executed it.
__________________
I looked it up on the Intergnats! |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Oct 2005
Posts: 56
Rep Power: 3
![]() |
When i ran "C:\Python24\Lib\site-packages\pygame " , there are many folders in it but not locals.py .
|
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
Hmm, locals.py is a short file that sets up the namespace "locals" for a bunch of pygame constants and functions:
"""Set of functions from PyGame that are handy to have in the local namespace for your module""" from pygame.constants import * from pygame.rect import Rect import pygame.color as color Color = color.Color What is the name of the file you downloaded from the Pygame site?
__________________
I looked it up on the Intergnats! |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Oct 2005
Posts: 56
Rep Power: 3
![]() |
pygame-2.7.1release.win32-py2.4
|
|
|
|
|
|
#6 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
2.7.1?
__________________
I looked it up on the Intergnats! |
|
|
|
|
|
#7 |
|
Programmer
Join Date: Oct 2005
Posts: 56
Rep Power: 3
![]() |
Ya , Sane sent me that one , after the one i loaded from pygame.org gave me the same error .
|
|
|
|
|
|
#8 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
Must be Sane's private connection with Pygame. Are you using Windows XP?
__________________
I looked it up on the Intergnats! |
|
|
|
|
|
#9 | |
|
Expert Programmer
|
Quote:
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
|
|
#10 |
|
Programmer
Join Date: Oct 2005
Posts: 56
Rep Power: 3
![]() |
Ya i'm using windows xp
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|