Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What tools are there to cross-create an OSX installer for a python package?

Distutils offers existing solutions to build a Windows self-extracting EXE. Notably, I can create the package even if I'm on Ubuntu (which is essential given our automated build process).

How do I build an osx installer from an Ubuntu machine?

(This is for python 2.7)

like image 691
UsAaR33 Avatar asked May 04 '12 05:05

UsAaR33


People also ask

Does PyInstaller work on Mac?

PyInstaller supports making executables for Windows, Linux, and macOS, but it cannot cross compile. Therefore, you cannot make an executable targeting one Operating System from another Operating System.

How does PyInstaller work?

PyInstaller reads a Python script written by you. It analyzes your code to discover every other module and library your script needs in order to execute. Then it collects copies of all those files – including the active Python interpreter!


1 Answers

Py2app, cx_freeze, and py2exe are for creating standalone applications, not installers.

You can use Python distutils to create a zip file of your package, and then wrap the zip file in a script that self-extracts and installs the package, like this: http://www.noah.org/wiki/Self-extracting_Python_Script

Or, if you want to create an installer that displays a GUI with a click-through license, then you need OS X PackageMaker to create an mpkg file. I don't think there's a Linux equivalent. If you want to try building an mpkg by hand, try this answer: PackageMaker for creating Mac packages on Windows/Linux

like image 175
dave Avatar answered Oct 05 '22 13:10

dave