How to bundle a Python application including dependencies?

前端 未结 7 2041
心在旅途
心在旅途 2020-11-28 03:09

I need to package my Python application, its dependencies and Python into a single MSI installer. The end result should desirably be:

  • Python is installed in th
相关标签:
7条回答
  • 2020-11-28 03:43

    My company uses the free InnoSetup tool. It is a moderately complex program that has tons of flexibility for building installers for windows. I believe that it creates .exe and not .msi files, however. InnoSetup is not python specific but we have created an installer for one of our products that installs python along with dependencies to locations specified by the user at install time.

    0 讨论(0)
  • 2020-11-28 03:46

    Ok, I have used py2exe before and it works perfectly except for one thing... It only works on executable windows machines. I then learned about Jython which turn a python script into a .Jar file. Which as you know is executable from any machine that has Java ("To your latest running version") installed. Which is great because both unix, windows, and ios (Most of the time) Run java. That means its executable from all of the following machines. As long as they run Java. No need for "py2mac + py2exe + freeze" just to run on all operating systems. Just Jython

    For more information on how it works and how you can use it click here.
    http://www.jython.org/

    0 讨论(0)
  • 2020-11-28 03:48

    Kind of a dup of this question about how to make a python into an executable.

    It boils down to:

    py2exe on windows, Freeze on Linux, and py2app on Mac.

    0 讨论(0)
  • 2020-11-28 03:48

    py2exe will make windows executables with python bundled in.

    0 讨论(0)
  • 2020-11-28 03:49

    I've had much better results with dependencies and custom folder structures using pyinstaller, and it lets you find and specify hidden imports and hooks for larger dependencies like numpy and scipy. Also a PITA, though.

    0 讨论(0)
  • 2020-11-28 03:58

    py2exe is the best way to do this. It's a bit of a PITA to use, but the end result works very well.

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