Pyinstaller: WARNING: lib not found

后端 未结 2 400
无人及你
无人及你 2021-01-25 14:09

I\'m trying create an executable from my code that uses PyQt5. I\'m using Python 3.5.3 -64 bits, developing in Windows 10, used pip to install pyinstaller 3.2.1, and installed p

相关标签:
2条回答
  • 2021-01-25 14:38

    After a lot of research, the problem is because of Windows 10. While I didn't find a Windows 10 solution, I did solve my problem in Windows 7.

    I tested pyinstaller on Windows 7 and was still getting warnings, but not the api-ms-win-crt-*.dll warnings.

    I copied all the dll files in my Python35 directory into the pyinstaller generated dist folder. At this point, pyinstaller can turn a Hello World program into an executable without errors:

    pyinstaller --onefile Hello_World.py
    

    However, turning a PyQt5 program into an executable gives errors because pyinstaller can't locate the Qt5*.dll files. To fix this copy the PyQt5, Qt5*.dll files, under Lib/site-packages/PyQt5/Qt/bin and into dist. Then tell pyinstaller where the dll files are using --path:

    pyinstaller --onefile --path dist Start_UI.py
    

    This creates a working executable Start_UI.exe in dist.

    0 讨论(0)
  • 2021-01-25 14:50

    Looks like the error was due to vcruntime140.dll not being included in the dist folder. Check the executable after manually copying it to the dist folder

    0 讨论(0)
提交回复
热议问题