[Distutils] obtaining easy_install prefix in setup.py

Christophe Pradal christophe.pradal at cirad.fr
Thu Nov 19 12:18:52 CET 2009

Pavol Juhas a écrit :
> Anybody else out there with a need to deploy a shared C library
> with a Python package?
Yes. To deploy Python libraries with extension modules, or even shared 
libs on different OS (Linux, Mac and Windows) we have implemented 
OpenAlea.Deploy as an extension of setuptools. (see

OpenAlea.Deploy call scons scripts which copy in a build directory libs, 
headers and bin.
3 files are added to the egg (lib_dirs.txt, bin_dirs.txt and include_dirs).

When a new egg containing shared libs is added, all the shared libs are 
copied in a share directory to avoid conflicts. This allow us to install 
all our dependencies as egg and to share libs on Windows.

We have also extended SCons to retrieve the path of the libs installed 
with eggs
(see OpenAlea.SConsX).

There is a support for post install scripts.

However, we have modified easy_install into alea_install to call 
build_py command after build_ext ones.

More information about the Distutils-SIG mailing list