Failed to load dynlib/dll (Pyintaller)

Viewed 4573

After using the pyintaller to transfer the py file to exe file, the exe file throws the error: "Failed to load dynlib/dll". Here is the error line:

main.PyInstallerImportError: Failed to load dynlib/dll 'C:\Users\YANGYI~1\AppData\Local\Temp\_MEI215362\sklearn\.libs\vcomp140.dll'. Most probably this dynlib/dll was not found when the application was frozen. [1772] Failed to execute script 2

after get this, I did check the path and I did not find a folder called "_MEI215362" in my Temp folder, I have already made all files visible. Also, I have re-download the VC but and retransferring the file to exe, but it didn't work. Any ideas how to fix the issue? Thank you in advance!

2 Answers
# I solved this exact problem by adding this to the spec file:
b = [
    ('C:\\path to python\\Python\\Python38\\Lib\\site-packages\\sklearn\\.libs\\vcomp140.dll', '.\\sklearn\\.libs')
    ]

and then 
a = Analysis(['pythonFilename.py'],
             pathex=[],
             **binaries=b,**
             datas=[] # , .....
             )

I also encountered a similar problem like Martin. In my case, however, it was the ANSI64.dll missing... So, I simply put the particular dll file into the dist directory. Lastly, I keep the exe and related raw data files (e.g. xlsx, csv) inside the "dist" folder and to run the compiled program. It works well for me.

Related