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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.