[Numpy-discussion] Distributing prebuilt numpy and other extensions
Russell E. Owen
Wed Feb 21 17:39:14 CST 2007
In article <D3A11D21-A268-41B3-9819-3C6F13D0A8B5@stanford.edu>,
Zachary Pincus <firstname.lastname@example.org> wrote:
> Hello folks,
> I've developed some command-line tools for biologists using python/
> numpy and some custom C and Fortran extensions, and I'm trying to
> figure out how to easily distribute them...
> For people using linux, I figure a source distribution is no problem
> at all. (Right?)
> On the other hand, for Mac users (whose computers by default don't
> have the dev tools, and even then would need to get a fortran
> compiler elsewhere) I'd like to figure out something a bit easier.
> I'd like to somehow provide an installer (double-clickable or python
> script) that does a version check and then installs an appropriate
> version of prebuilt binaries for numpy and my C and Fortran
> extensions. Is this possible within the bounds of the python or numpy
> distutils? Would setuptools be a better way to go? Preferably it
> would be a dead easy, one-step thing...
> Or is this whole idea problematic, and better to stick with source
> distribution in all cases?
As Robert Kern said, using bdist_mpkg is a nice easy way to create a
double-clickable Mac installer for python code. It builds an installer
package using the normal setup.py file for your stuff.
Lots of packages built this way are available at:
But if you want one installer that installs everything then, you have to
figure what to do if the user already has some of the your python
packages installed (e.g. numpy). Overwrite the existing package? Somehow
install it in parallel and have the user pick which version to use?
None of this is automated in bdist_mpkg. It is set up to install one
python package at a time. So...
For your project I suspect you would be better off using easy_install
and packaging your project as a python "egg". easy_install is
cross-platform, handles dependencies automatically and can install from
source or precompiled binaries. That said, I've not actually used it
except to install existing eggs, though I'd like to find some time to
More information about the Numpy-discussion