0

hell everyone,i am ruuning a program from headfirst programming using pygem.....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

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by C0deM0nkey
0

Are you sure you installed pygame currectly? Try to make a simple "Hello World" program in pygame. If it doesn't work, reinstall pygame. I think you may have a problem in the directory pygame is installed. Try installing it in C:\Python32\Lib\site-packages\pygame

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.