Problem deploying Python program (packaged with py2exe)

前端 未结 4 1896
故里飘歌
故里飘歌 2021-01-07 09:26

I have a problem: I used py2exe for my program, and it worked on my computer. I packaged it with Inno Setup (still worked on my computer), but when I sent it to a different

相关标签:
4条回答
  • 2021-01-07 09:36

    When you run py2exe, look closely at the final messages when it's completed. It gives you a list of DLLs that it says are needed by the program, but that py2exe doesn't automatically bundle.

    Many in the list are reliably available on any Windows install, but there will be a few that you should manually bundle into your Inno Setup installation. Some are only needed if you want to deploy on older Windows installs e.g. Win 2000 or earlier.

    0 讨论(0)
  • You should be able to install that MS redistributable thingy as a part of your InnoSetup setup exe.

    0 讨论(0)
  • 2021-01-07 09:47

    You can ship the runtime DLLs in question with your application as a "private assembly". This simply means putting a copy of a specially-named directory containing the runtime DLLs and their manifests alongside your executable.

    See my answer to this post.

    0 讨论(0)
  • 2021-01-07 09:54

    You need to include msvcr90.dll, Microsoft.VC90.CRT.manifest, and python.exe.manifest (renamed to [yourappname].exe.manifest) in your install directory. These files will be in the Python26 directory on your system if you installed Python with the "Just for me" option.

    Instructions for doing this can be found here.

    Don't forget to call multiprocessing.freeze_support() in your main function also, or you will have problems when you start a new process.

    While others have discussed including the MSVC runtime in your install package, the above solution works when you only want to distribute a single .zip file containing all your files. It avoids having to create a separate install package when you don't want that additional complication.

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