how to find site-packages path (Michael Hoffman) - use distutils

David Fraser davidf at
Wed Jan 19 04:52:07 EST 2005

Philippe C. Martin wrote:
> I actually target Unix and windows so pyexe won't cut it I'm afraid -
> same issue with Inno.
> As far as the site-package target, I don't fully understand your
> relunctancy. Just as my potential users might not own a compiler, they
> might not be computer proficient enough to easily understand how to
> change the sys.path. So until I have found a clean cross platform
> solution I'm going to have to stick to site-packages.

Hi Philippe

You may want to have a look at

This was originally a patch to distutils which enabled removing the 
source (i.e. only distributing compiled files). I have now attached a 
file there which enables you to do the same thing, but without patching 
distutils - it just wraps functions etc from outside.

Basically you call allow_distutils_remove_source in the module and it 
does the neccessary changes. Then you get a --remove-source options to 
most of the commands. You can also selectively override what gets 
removed if you want by changing the is_removable function

I hope this is useful for what you're wanting to do


More information about the Python-list mailing list