Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 609
OperationJynx Avatar asked Nov 06 '22 21:11

OperationJynx


1 Answers

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!

like image 88
José Gil Ramírez Avatar answered Nov 15 '22 06:11

José Gil Ramírez