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

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

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

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

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

All the options given above didn't work for me. So, i uninstalled and reinstalled the "pygame" library from this site. https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame. which worked well.

When you newly install the pygame, it require system restart.
Just Restart your PC/Laptop
and then Run the code, it will not throw any error.
The answer of #jrsylvester right, but there is some questions.
Why and when you will get this type of error?
Why need to restart the pc/laptop?
Answer : When you newly installed the pygame and execute your code, then it will throw an error.
The system require a reboot to setup their file or code for working environment. so restart your PC/Laptop.
Happy Coding..!

Go to the directory where pygame is installed (you can get it by typing pip install pygame).
Look for the libmpg123.dll in pygame directory.
Copy and paste to C:/windows/system3 and C:/windows/sysWOW64.

1.Go to the directory where pygame is installed (you can get it by typing pip install pygame).
2.Look for the libmpg123.dll in pygame directory.
3.Copy and paste to C:/windows/system3 and C:/windows/sysWOW64.

I got this error message because I used the version of Python that was installed from the Windows Store. I reinstalled from official Python and the error went away.

Had the same issue. Surely enough just restarting my IDE or computer didn't help as well as copypasting libmpg123.dll to Windows directories or simply reinstalling pip/pygame.
I was using Python 3.9 from Microsoft Store. Before giving up and reinstalling Python from Python.org, I downloaded pygame‑2.1.2‑cp39‑cp39‑win_amd64.whl and then run:
pip install pygame-2.1.2-pp38-pypy38_pp73-win_amd64.whl
This worked perfectly well for me without python reinstallation.

I was under the same problem what i did was simply Install another IDE or just try reinstalling pygame.

Related

Replit error: /usr/bin/env: ‘./python3’: No such file or directory after using PIP

whenever I type, for an example: pip install aiohttp==3.7.3, it gives me: /usr/bin/env: ‘./python3’: No such file or directory is there any way to fix it? (The error is in REPLIT)
I had problems with using aiohttp in REPLIT, I tried uninstalling package files. I "reinstalled" packages, such as "aiohttp" after doing the problem referred to the title popped up in the console.
I ran into this error as well and haven't been able to solve it.
In the meantime, I use python3 -m instead and it works:
python3 -m <module-name> <args>
Well, go to .replit and delete the Variable called hidden = ["venv", ".config", "**/__pycache__", "**/.mypy_cache", "**/*.pyc"]
after deleting, go to the file directly and download the module to your computer, then upload it to the file it's not in.
I hope this works,
-JKID_Tech
P.S. I tried this IT WORKS if you get python from your computer then go to the python files or try to find it on the internet for example PyPI

Why does repair python return "Can't write to file" even though i have access to the specified directory? [duplicate]

I am trying to install Python 2.7 (64 bit) on Windows 10. In the middle of the installation, a window pops up saying:
Error writing to file C:\Python27\pythonw.exe. Verify that you have
access to that directory
How can I resolve this issue and install Python?
This error is normally encountered when the installer does not have admin rights for the drive/folder you are installing to. I also noticed that you are installing to drive C:
Here are a couple of things for you to try.
Open the installer program by right-clicking, and then selecting "Run as Administrator".
Depending on how you have your PC set up you may not have permission to install on drive C:
If this is a work computer, talk to your IT department. Otherwise, seriously consider using different drives to keep your OS and your applications separated.
I encountered a similar issue while installing Python 2.7.11 on Windows 7 (64bit). Here is how I solved the error.
Note down the path mentioned in the error.
Do not close the error message. i.e. Do not press "Retry" or "Cancel", let it be there.
Go to the directory mentioned in step-1.
Try to create a new folder or text file in this directory.
You will get an error message saying "The Disc Structure is Corrupted and Unreadable". This is the real issue which is causing the Python installation to fail.
Run Command Prompt as an administrator and enter the command: Chkdsk \f C:
Either it will start checking the disc or it will ask you to select if you want to check disc next time you boot-up your machine. Select Yes and restart your machine.
A disc check will be performed, which may take 5-10 minutes.
Now you can install Python without any issue.
I had the same problem , this is how I solved the error :
click on cancel
go to c:\
create a new folder and call it python or python3
run the python install as administrator and choose the new folder that you just created
as directory where it should be installed
et voila !
Your Windows 10 version may not be activated. So many administrator features are locked in inactivated Windows10 version.
So try to open CMD in administrator mode and run following command to ignore the activation message.
slmgr -rearm
Now you can install fresh version of python with pythonw.exe features.
Right Click The running Uninstaller. Then Right Click Python 3.9.1 64-bit as shown below in the picture. ( I have Python 3.9.1. You can do it in any Uninstaller) Now it will repair without any errors. ^_^

No Python 3.8 installation was detected

Python installation screenshot
1.i Uninstall everything of python with advance uninstaller . ( register file and ...)
2.i download the last version of Python from python.org
3. i add the Include PATH file when start the installation of Python.
BUT I don't KNOW WHY ITS NOT Installed !
Delete Python3 Folder--> C:\Users\USERNAME\AppData\Local\Programs\python
Control Panel--> Uninstall a Program
Right Click on Python and then Change--->Modify
Click on Repair Python.
and then:
Control Panel --> Uninstall a Program
Now -->uninstall Python
Note: To avoid problems, it is better Delete path Python in edit environment variables windows
Error Code 0x80070643
I found it.
if you are not administrator of the system , and change the location of installation , for example (c:\python) this error will be appear .
so you must be install python on (c:\users\'your username'\App Data\Local\Programs\Python)
and after installation python go to system environment and add the path into this.
For Windows 10 :
First install windows x86-64 executable installer and open it.
Then click on repair and done.
If this occurs while uninstallation :
Do the above steps and then uninstall it.
I accidentally copied the python folder from the installed location into my C drive and encountered this problem. Following steps worked for me.
Run the Python installer (.exe) file
Select the repair option, let it process.
Run the Installer again. This time select uninstall and let it process
Run the Installer again and this time go with the customization option and check the
Add path option also.
open cmd and type python --version, if it displayed python version. You are good to go.
Windows 10.
Had this issue from a while and after a lot of hit & trials, finally resolved it.
Downloaded the Windows troubleshooter.
Removed every application option with Python's name as suffix, and tried uninstalling from Control panel.
It worked. And then I installed the required python version with ease.
Troubleshooter : MicrosoftProgram_Install_and_Uninstall.meta.diagcab
Link to download : https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d
Choose custom installation then next .. your problem will get solve it worked for me.

Getting "targetdir variable must be provided when invoking this installer" message

when i try to install python i'm getting the "targetdir variable must be provided when invoking this installer" whilst attempting to install python 3.5. I have used tried to Run as admin however, I', still getting this error.
I had the same problem today and it did not work even with "run as administrator".
To solve the problem, I ran powershell as administrator and executed the following command:
python-3.6.1.exe InstallAllUsers=1 TargetDir="c:\python3.6"
Just right click on exe file and run as a administrator.It worked for me :)
I met this issue also.
I find method to resolve it.
Right click the exe file and choose run as administrator.
Then it can go on installing and to be successful.
Run as administrator solves this problem!
I was trying to install the latest python for windows python-3.7.0b4-amd64-webinstall but got the same error.
The problem was solved by the following steps:
Open command prompt in administrator mode.
Go to the location where the installer is downloaded.
C:\>cd C:\Users\XYZ\Downloads
C:\>python-3.7.0b4-amd64-webinstall.exe TargetDir=C:\Python37
The installer will open and chose the default installer and click Install.

I don't know how to get Py2app

I'm on Mac OSX 10.10.2. I've tried this once before and got a lot of hate for not being as smart as people assumed I was. I'll say this right now: I don't know anything about Terminal.
I do not have working pip, and I tried following these instructions to install pip, but even though I have get-pip.py sitting right on my desktop, whenever I execute the command it tells me to in terminal, I get an error: "No such file or directory." Can someone walk me through the steps of getting Py2app, and pip if that's necessary? I apologize in advance for my stupidity, and thanks for the help!
Even after I downloaded get-pip.py, it wasn't working because I didn't specify the location. Before executing python get-pip.py, I had to speficy location. So, on the first line of Terminal, type cd ~/Desktop and press enter. Then execute python get-pip.py, and it should work. Did for me!

Categories

Resources