[Distutils] obtaining easy_install prefix in setup.py

Pavol Juhas pj2192 at columbia.edu
Thu Nov 19 06:59:56 CET 2009

On Wed, Nov 18, 2009 at 07:45:34PM -0500, David Lyon wrote:
> Is this only for the linux/mac version? I tried the windows version
> of diffpy and it uses a nsis installer and that all seemed to work fine
> on my test machine.

Hi David,

The shared C++ library is necessary for new packages that are not
yet released on diffpy.org, but they should work under both linux/mac
and windows.  Our current release has source packages for linux/mac
that are deployed by easy_install, for windows we roll out an NSIS
bundle, that contains a dedicated Python with all 3rd-party
dependencies (numpy, matplotlib, etc.) and binary eggs for any
packages that have extension modules.  The idea was to allow
easy_install package upgrades in the same way on both Linux and
Windows and also allow our software to be added to an existing Windows
Python tree.

Deploying shared library on Windows opens a whole new can of worms.
It can be included in an NSIS bundle, but I don't see it possible
to support upgrades with easy_install.  Should not be a big deal
as the Windows users probably prefer the NSIS bundle anyway.

> So, you want to find the "full path" of the install directory for
> post install processing? (using non-distutils installation terminology)

Yes, that is correct.  I don't know how to start a post-install
processing from setup.py, apart from overloading one of the
distutils/setuptools commands.  As PJE mentioned, it is indeed
possible to walk the stack trace and rip out the original sys.argv
(and its '--prefix' element) from the easy_install main.  It is an
atrocity, but perhaps the only thing left to do.

Anybody else out there with a need to deploy a shared C library
with a Python package?

Thank you,


More information about the Distutils-SIG mailing list