First of all i'm on windows and i'm trying to convert my python programm to an executable. My Programm is a console based music player. I'm using the pygame mixer to play my mp3 files. I converted it to an executable using auto-py-to-exe.
As .py in PyCharm, the programm worked perfectly fine, but when I start the .exe it immediately crashed.
In the PowerShell i get this error message:
pygame 2.0.0.dev6 (SDL 2.0.10, python 3.8.2)
Hello from the pygame community. https://www.pygame.org/contribute.html\ Traceback (most recent call last):
File "MPMbeta.py", line 569, in module
File "MPMbeta.py", line 550, in load_settings
File "MPMbeta.py", line 46, in set_song
pygame.error: Failed loading libmpg123-0.dll:
[10464] Failed to execute script MPMbeta
So the function that crashed the programm was:
def set_song(self, name):
self.name = name
pygame.mixer.pre_init(44100, -16, 2, 2048)
self.mixer.load(Player.path + name)
self.mixer.play(1)
self.mixer.set_volume(self.volume)
self.current_song_len = int(MP3(Player.path + name).info.length) * 1000
That's why i think the pygame mixer crashed the programm. Pygame itself worked fine as the "Hello from the pygame community." indicates.
So my question is why does the pygame mixer has no problem loading libmpg123-0.dll when in PyCharm but as .exe? And how can i resolve that issue?