Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pygame.error: Failed loading libmpg123.dll: Attempt to access invalid address

music = pygame.mixer.music.load('not.mp3')
pygame.mixer.music.play(loops=-1)

when executing the code I got this error:

Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\Escape it!.py", line 15, in <module>
    music = pygame.mixer.music.load('not.mp3')
pygame.error: Failed loading libmpg123.dll: Attempt to access invalid address.

I have tried everything from giving full path to only the name but everytime this shows up

like image 597
Saswot Lamichhane Avatar asked Jan 07 '20 07:01

Saswot Lamichhane


3 Answers

Just close whatever IDE you are using and restart the system. It worked for me!

like image 148
jrsylvester Avatar answered Nov 19 '22 06:11

jrsylvester


Restart your IDE if that doesn't work try restarting your PC it worked for me!!

like image 25
John Marshall Avatar answered Nov 19 '22 05:11

John Marshall


Doing following steps maybe solve the problem:

Step 1: Go to browser and search download libmpg123.dll.

Step 2: download libmpg123.dll and Extract it.

Step 3: After Extract (cut or copy) the two docs and paste in "C:\Windows\System32".

Step 4: Installation successfully done.

And this is also works :-

music = pygame.mixer.music.load('not.mp3')
pygame.mixer.music.play(loops=-1)

Thanks You

like image 1
Raj gaurav Avatar answered Nov 19 '22 06:11

Raj gaurav