Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to load dynlib/dll (Pyintaller)

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!

like image 301
ColdWing Avatar asked Sep 12 '25 09:09

ColdWing


1 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=[] # , .....
             )
like image 116
Martin Avatar answered Sep 15 '25 00:09

Martin