Minimal set of files required to distribute an embed-Cython-compiled code and make it work on any machine

后端 未结 1 764
感动是毒
感动是毒 2020-12-01 20:17

TL;DR: how to use Cython as a distribution method instead of Py2exe, cx_freeze, pyinstaller, etc.


Following Making an executable in Cython, I\'d like to see ho

相关标签:
1条回答
  • 2020-12-01 21:16

    After further research (I tried in an empty Win 7 x64 bit VM, without any VCredist previously installed), it seems that these files are enough:

    • the program itself, test.exe (produced by cython --embed and compilation with cl.exe)

    • python37.dll

    • python37.zip coming from packages named "Windows x86-64 embeddable zip file" in https://www.python.org/downloads/windows/

    • vcruntime140.dll, as mentioned in Can I bundle the Visual Studio 2015 C++ Redistributable DLL's with my application? or ask the user to install vc_redist.x64.exe before

    • ucrtbase.dll

    • more than 30 files api-ms-win-*.dll were required too; if not you will have the following error:

      ... api-ms-win-crt-runtime-l1-1-0.dll is missing ...

    Notes:

    • if you require another library, like pygame, just copy/paste the folder from C:\Python37\Lib\site-packages\pygame seems to work

    • for me, concrt140.dll, msvcp140.dll, vccorlib140.dll did not seem necessary

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