I am receiving an error message (included below) when I try to run my gaming program with sound. I have a MacBook Air, 2017 and I am running Mac OS 10.13.6. After looking at this error message included below, I am wondering:
- Does this look like a programming error or that the mixer module is not installed?
- Is it not installed because I am running an older Mac OS?
- If the answer is yes to #2, what are my options moving forward that do not involve buying a new computer?
Thanks for your patience. I am a new programmer, and this is my first post. If I am breaking any posting formats/conventions, it is only due to my own ignorance, and I apologize. If so, please set me straight. Thanks!
pygame 2.2.0 (SDL 2.0.22, Python 3.11.0)
Hello from the pygame community. https://www.pygame.org/contribute.html
/Users/lens14/Desktop/python_work/alien_invasion/alien_invasion.py:40: RuntimeWarning: use mixer: dlopen(/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/mixer.cpython-311-darwin.so, 2): Library not loaded: @loader_path/libmp3lame.0.dylib
Referenced from: /Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/.dylibs/libsndfile.1.0.34.dylib
Reason: no suitable image found. Did find:
/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/.dylibs/libmp3lame.0.dylib: cannot load 'libmp3lame.0.dylib' (load command 0x80000034 is unknown)
/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/.dylibs/libmp3lame.0.dylib: cannot load 'libmp3lame.0.dylib' (load command 0x80000034 is unknown)
(ImportError: dlopen(/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/mixer.cpython-311-darwin.so, 2): Library not loaded: @loader_path/libmp3lame.0.dylib
Referenced from: /Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/.dylibs/libsndfile.1.0.34.dylib
Reason: no suitable image found. Did find:
/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/.dylibs/libmp3lame.0.dylib: cannot load 'libmp3lame.0.dylib' (load command 0x80000034 is unknown)
/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/.dylibs/libmp3lame.0.dylib: cannot load 'libmp3lame.0.dylib' (load command 0x80000034 is unknown))
self.bulletSound = pygame.mixer.Sound('Game_bullet.wav')
Traceback (most recent call last):
File "/Users/lens14/Desktop/python_work/alien_invasion/alien_invasion.py", line 354, in <module>
ai = AlienInvasion()
^^^^^^^^^^^^^^^
File "/Users/lens14/Desktop/python_work/alien_invasion/alien_invasion.py", line 40, in __init__
self.bulletSound = pygame.mixer.Sound('Game_bullet.wav')
^^^^^^^^^^^^^^^^^^
File "/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/__init__.py", line 70, in __getattr__
raise NotImplementedError(missing_msg)
NotImplementedError: mixer module not available (ImportError: dlopen(/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/mixer.cpython-311-darwin.so, 2): Library not loaded: @loader_path/libmp3lame.0.dylib
Referenced from: /Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/.dylibs/libsndfile.1.0.34.dylib
Reason: no suitable image found. Did find:
/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/.dylibs/libmp3lame.0.dylib: cannot load 'libmp3lame.0.dylib' (load command 0x80000034 is unknown)
/Users/lens14/Library/Python/3.11/lib/python/site-packages/pygame/.dylibs/libmp3lame.0.dylib: cannot load 'libmp3lame.0.dylib' (load command 0x80000034 is unknown))
So far:
- I have tried running the program without any sound commands, and it works fine.
- I watched an online tutorial about adding sound commands. The tutorial seemed understandable, so I just integrated the instruction into my code.
- I tried cutting and pasting pieces of the error message into my search browser, but nothing seemed really definitive on what was wrong.