简体   繁体   中英

Pyinstaller - Error loading Python DLL - FormatMessageW failed

I compiled my .py file running following commands:

pyinstaller myfile.py --onefile.

When i run it on my pc(Windows 10) everything works just fine.

When i try to run it on my `virtual machine(Windows 8).

I get the following error:

Error loading Python DLL 'C:\Users\MyUsername\Appdata\Local\Temp\NUMBERS\python36.dll' LoadLibrary: PyInstaller: FormatMessageW failed.

I already googled the error and i found many solutions but none of them worked..

//UPDATE: If i compile it with my virtual machine, everything runs fine on the virtual machine, main pc and even on my windows server.. strange.. so it must be a problem with my main pc.

Kind Regards

I had a similar problem trying to run a python-based program (aws cli) and getting the "Error loading Python DLL ... LoadLibrary: The specified module could not be found." on Windows Server 2008 R2.

I solved this issue by installing the Visual C++ Redistributable for Visual Studio 2015 run-time components. https://www.microsoft.com/en-us/download/confirmation.aspx?id=48145

Hope it helps!

you can use instead the auto-py-to-exe instead just use the cmd or terminal and write:

C:\\Users\\walee>pip install auto-py-to-exe

And then wait for it to download and then write in then cmd (or terminal) : C:\\Users\\walee>auto-py-to-exe And wait for it to download and then a screen will appear enter image description here

And just make as I made in the photo and then press convert .py to .exe and then press show output folder

This also happens when you read the.exe file located in build.

You need to run the exe located in dist folder.

If the error persists even on dist folder.exe, check the exact version of python, download python dll from inte.net for that exact version, in keep in the folder suggested by the error message (path where this dll is missing).

Try to download a 32 bit version of python36.dll (or 64 if you tried 32)

That fixed the problem for me

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM