Solving Python Pygame Error – pygame.error: Failed loading libmpg123.dll: Attempt to access invalid address

Python Pygame Error – pygame.error: Failed loading libmpg123.dll: Attempt to access invalid address is an error which occurs when libmpg123.dll is missing or when you have another issue.

Today I will be explaining why this error is taking place and how to solve it.

Exploring the Python Pygame Error – pygame.error: Failed loading libmpg123.dll: Attempt to access invalid address

This is an error which occurs when libmpg123.dll is missing or when you have another issue.

Please double check so you can avoid mixing between errors. The error message should look like the error message bellow.

                                                                       #
Failed loading libmpg123.dll: Attempt to access invalid address
                                                                       #

Bellow we will describe how the error can be solved. With multiple possible solutions.

Solution 1 : Download and install libmpg123.dll

The first solution is to download and install libmpg123.dll

Go to the following link : https://www.dll-files.com/libmpg123-0.dll.html

Download and Extract libmpg123.dll

Paste the files from the extracted folder here :

                                                                       #
C:\Windows\System32
                                                                       #

That is it, I hope the above has solved your problem, try the methods bellow if that is not the case.

Solution 2 : Add libmpg123.dll to sysWOW64 and system3

Run the command bellow and copy the directory where pygame has been installed.

                                                                       #
pip install pygame
                                                                       #

Search for libmpg123.dll in that directory

Navigate to the two paths bellow. And paste libmpg123.dll there.

                                                                       #
C:/windows/sysWOW64
C:/windows/system3
                                                                       #

I hope the fix above fixed your problem. Please try the method bellow if that is not the case.

Solution 3 : Restart your IDE or your Machine

The last method might look simple but it can be very effective.

Try Restarting your IDE , if that does not work Try closing your IDE and then run it as an administrator.

If the above does not work try restarting your machine.

I hope the methods I provided solved your issue, good luck with your projects and thank you for reading this to the end.

Summing-up : 

That is it guys, this is the end of this article aka guide, I hope you found it useful in solving the error : Python Pygame Error pygame.error Failed loading libmpg123.dll Attempt to access invalid address , make sure to support our work on Kofi, you do not have to but hey you can donate to the team.

Thank you for reading my blog post to the end, If you want to learn more about the Python programming language, check out the official Python Documentation : https://docs.python.org/3/