O'Reilly Forums: Problem Using Pygem - O'Reilly Forums

Jump to content

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

Problem Using Pygem

#1 User is offline   subhra 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 14-December 11

Posted 14 December 2011 - 11:34 PM

hell0 everyone,i am ruuning a program from headfirst programming using pygem.....

i downloaded pygame-1.9.2a0.win32-py2.7.msi 6.4MB and after installing i get two folder one is lib and another one is include after that i copied the two folder in c:\python\32\lib


so now...


my pygem is installed in this location
------->
C:\Python32\Lib\Lib\site-packages\pygame



now my piece of code is:

from tkinter import *
import pygame.mixer
app = Tk()
app.title("Head First Mix")
app.geometry('250x100+200+100')
sound_file = "Sototar Bilasita.wav"
mixer = pygame.mixer
mixer.init()
def track_start():
track.play(loops = -1)
def track_stop():
track.stop()
track = mixer.Sound(sound_file)
start_button = Button(app, command = track_start, text = "Start")
start_button.pack(side = LEFT)
stop_button = Button(app, command = track_stop, text = "Stop")
stop_button.pack(side = RIGHT)
app.mainloop()


and i am getting this error ehile running....


Traceback (most recent call last):
File "C:\Python32\p2\mixer.pyw", line 2, in <module>
import pygame.mixer
ImportError: No module named pygame.mixer

0

#2 User is offline   edge-board 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 08-April 12
  • Gender:Male

Posted 08 April 2012 - 10:19 PM

I am afraid I can't help you solve the problem.
[url=http://www.edge-board.com][b]Edge Board[/b][/url]
[url=http://www.edge-board.com][b]paper angle[/b][/url]
[url=http://www.edge-board.com][b]honeycomb paper box[/b][/url]
0

#3 User is offline   paulbarry 

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

Posted 15 April 2012 - 01:10 PM

You have downloaded and installed PyGame for Python 2.7, but you are trying to run the code under Python 3.2, which won't work. Please ensure that the version of PyGame matches and works with your installed Python.

--Paul.
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