[Distutils] SetupTools: Running EasyInstall From Within A Script?

Phillip J. Eby pje at telecommunity.com
Fri Nov 17 18:59:49 CET 2006

At 12:42 PM 11/17/2006 -0500, Alexander Michael wrote:
>I am attempting to put together a simple package installation
>replicator to make it easier to pull updates from a local repository
>(as an alternative setup to a shared NFS directory). The idea is to
>put a requirements list and the necessary eggs in a local shared
>directory and then have a script on each computer do a quick check to
>see if any updates are needed and install them if there is an update.
>Is it possible to ask setuptools to install a package from within a
>Python script without resorting to os.system or friends? I tried
>browsing the source, but it was difficult to follow the call chain
>from the easy_install script to the actual method being called.

The simplest way:

from setuptools.command.easy_install import main
main(['some', 'arguments', 'here'])

More information about the Distutils-SIG mailing list