O'Reilly Forums: Help! Pygame Is Still Not Working - And Yes I Have Read The Other Threads - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help! Pygame Is Still Not Working - And Yes I Have Read The Other Threads

#1 User is offline   j.e.k. 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 16-March 11

Posted 16 March 2011 - 07:39 PM

I uninstalled Python 3.2 and installed Python 3.1 like it was advised below.

I still get this when I try to run a program that uses Pygame (pg 221):

Traceback (most recent call last):
File "C:\Users\JohnKrantz\Desktop\python projects\sounds.py", line 1, in <module>
import pygame.mixer
ImportError: No module named pygame.mixer


What am I doing wrong?

The Pygame website is extremely unhelpful for beginners, I'm not sure why we would be expected to rely on it. (i.e., what the heck is a "Windows Binary"?)

The Head First website is not any help either: "The Pygame website has a downloadable installer for Windows that works with Python 3. Simply download, double-click to install and you're golden. "

Well I did that and no, I'm not even close to golden. The installer didn't do anything. There are no new programs under "All Programs", and I just have some folders on my desktop with a lot of python code in it that Python doesnt seem to recognize even when I copy them into the same folder as the programs that use them.

Why is installing pygame so damn hard? Can anyone help a noob?
0

#2 User is offline   paulbarry 

  • Advanced Member
  • PipPipPipPipPipPipPipPip
  • Group: O'Reilly Author
  • Posts: 306
  • Joined: 20-August 09

Posted 17 March 2011 - 07:59 AM

I'm sorry to hear that you are having trouble.

It helps if you can decipher the PyGame file naming conventions. Here is the link you'll need to the Python 3.1-specific version of the PyGame download:

http://pygame.org/ftp/pygame-1.9.1.win32-py3.1.msi

which is the Windows 32-bit compatible version of PyGame (win32) for Python 3.1 (py3.1). Note that trying this with anything other than the 32-bit version of Python for Windows, here:

http://www.python.org/ftp/python/3.1.3/python-3.1.3.msi

is not guaranteed to work. So, all bets are off if you are running Python 3.2 and (also) all bets are off if you try to install the 32-bit PyGame onto 64-bit Python 3.1.

Both of these downloads (PyGame and Python) are Microsoft Windows self-extracting installers (.msi), so they should download, run and install without a hitch. Once done, you should be able to run the code in the book without the compatibility issues you report. FYI: these are the versions that David and I tested on when working on that and later chapters.

I hope this helps.

--Paul.

0

#3 User is offline   arbwar 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 07-October 11

  Posted 07 October 2011 - 05:37 AM

hi j.e.k I also had the no module named mixer error. I was using python 3.2 and pygame 1.9.2. Then I tried with python 3.1 and pygame 1.9.1 as suggested . Still got the same error. I tried in different ways and googled for one day but couldn't find a solution. I even posted in some forums. The next morning I found a solution. I think it has nothing to do with python and pygame versions.

We downloaded hpfrog_sounds folder for chapter 7. When you save your python file in hpfrog_sounds folder and run from there, you will get the no module named mixer error.


Put you python file and only necessary wave files(buzz,carhorn,ohno,heartbeat) in new a folder. Run. You will find it working now. :D
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users