Wednesday, 6 August 2008

Python Eggs

The Philosophy of Eggs

An increasing number of Python programs are being distributed as "runtime eggs". Eggs are simply a way of distributing Python programs similar to RPM. They are installed using easy_install.

An example of a package using eggs is Pyglet, a toolkit for games and visual effects (BSD-license).

A great deal of eggs can be found on the Python package index. They are installed in one of two ways:

easy_install package.egg
easy_install http://www..../package.egg

easy_install is based on the distutils package. Basic concepts of distutils can be found here.

The "Old Way"

Most packages currently come in tarballs that you unzip and then run:

python setup.py install

This will build and install everything in one step. If the build process is heavy you may want to split this up into two steps:

python setup.py build
python setup.py install

To install modules locally (in your own personal "stash") you need to do:

python setup.py install --home=<home>

No comments: