473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with Pygame

kaarthikeyapreyan
I have installed pygame v 1.8.0
The installation was sucessful, but the optional packages were not included like the font,movie etc
When i was trying to run the sample script that was given it showed me this error
Expand|Select|Wrap|Line Numbers
  1. $python fonty.py
  2. fonty.py:33: RuntimeWarning: use font: No module named font
  3.   font = pygame.font.Font(None, 80)
  4. Traceback (most recent call last):
  5.   File "fonty.py", line 89, in <module>
  6.     if __name__ == '__main__': main()
  7.   File "fonty.py", line 33, in main
  8.     font = pygame.font.Font(None, 80)
  9.   File "/home/numenta/Python-2.5.2/pythonconf/lib/python2.5/site-packages/pygame /__init__.py", line 52, in __getattr__
  10.     raise NotImplementedError, MissingPygameModule
  11. NotImplementedError: font module not available
And also

Expand|Select|Wrap|Line Numbers
  1. $python arraydemo.py
  2. Traceback (most recent call last):
  3.   File "arraydemo.py", line 13, in <module>
  4.     raise ImportError, 'Error Importing Pygame/surfarray or Numeric'
  5. ImportError: Error Importing Pygame/surfarray or Numeric
  6.  
  7.  
from where can i get these optional packages downloaded or do i have to set anything for before i get pygame installed to have the optional packages included
May 28 '08 #1
4 5853
jlm699
314 100+
For surfarray you will need Numeric, which has a link from the pygame download page.

I'm not sure about the "optional" font package. My 1.8.0 release installation has it I just need to do
Expand|Select|Wrap|Line Numbers
  1. import pygame
  2. import pygame.font
So perhaps try reinstalling it and seeing if you get it then.
May 28 '08 #2
This is what happened when imported the font module

Expand|Select|Wrap|Line Numbers
  1. >>> import pygame
  2. >>> import pygame.font
  3. Traceback (most recent call last):
  4.   File "<stdin>", line 1, in <module>
  5. ImportError: No module named font
The init file of pygame states that font is an optional package
and requests it to throw am not implemented error when called for it.
I wanted to know how i could include these files that are part of the font module, where are they found cause they were not downloaded as a part of my source
The pygame mod has an entry for the font module i.e dir(pygame)
but the init and the related files for the font module cannot be found
The size of the download was right (was not able to get hold of the md5)
May 29 '08 #3
jlm699
314 100+
dir(pygame) will show an entry font whether you have it or not. This is because the developers have placed a placeholder variable with the value of None when the package is not installed. This way, you can check if pygame.font == None before importing. What system did you install this on? I see that you have dual boots and I have a feeling this is on your non-windows box that you're experiencing problems... I'm wondering if you would be willing to simply install the windows package and see how that works for you.
If not I'm afraid I'm not very adept at installing packages on *nix boxen so I don't know how you would be able to look-up the install options when building the packages.
May 29 '08 #4
:)
Thats true am working on a linux box(SLES)
I was not able to get hold of the build option for the optional packages when i built it from the source in my machine
anyway thanks a lot dude ...
Jun 2 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: AnsNum | last post by:
hello, when I start this program, the movie doesn't play smoothly, anybody has an idea ? (I use windowsXP) import pygame from pygame.display import flip from pygame.locals import * ...
3
by: Tim Knauf | last post by:
Hi everyone, I'm glad to have found this list. I've written a small script for my own use which, amongst other things, captures mouse click information from a window containing an image. I used...
1
by: kjm | last post by:
Hi everyone, I have recently acquired a Logitech Rumble pad to use as an input device. I have been having trouble getting the event que to respond that a button or hat arrow has been pressed. ...
1
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image...
11
by: dynamo | last post by:
Hi guys i have come again with more problems.This time it has to do with pygame.The following code does not give any error messages but it does not do what it is supposed to do either.the code is a...
1
by: koolest1 | last post by:
Im working in red hat linux 9.0. I've downloaded the pygame package but there is some problem while installing it. For the tar version, initial steps execute OK, namely, # tar xzvf...
0
by: Grant Edwards | last post by:
I've got a system where I try to install extensions using /usr/local/bin/python setup.py install But, it fails when it tries to use a non-existant compiler path and specs file. I suspect it's...
1
by: joshuabraham | last post by:
os version =windows xp hi guys i'm having problems using pygame the following code just does not seem to work. clock=pygame.time.Clock() while True: sound1.play() clock.tick(60) ...
3
by: globalrev | last post by:
im doing this : http://www.learningpython.com/2006/03/12/creating-a-game-in-python-using-pygame-part-one/ and when closing the program the window stays up and doesnt respond. i tried adding...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.