[Distutils] virtual-python.py, sys.prefix, and Mac

Ronald Oussoren ronaldoussoren at mac.com
Sun Sep 16 21:38:16 CEST 2007

On 15 Sep, 2007, at 18:09, Ian Bicking wrote:

> Hi all.  I'm kind of giving up on workingenv, and have started working
> from virtual-python as a basis instead
> (http://pypi.python.org/pypi/virtualenv/).
> So the basic technique here is to copy the executable into
> /ENV/bin/python, and then sys.prefix will be '/ENV'.  The standard
> Python installed on a Mac doesn't seem to do this -- the prefix  
> remains
> '/opt/local/Library/Frameworks/Python.framework/Versions/2.4'
> regardless.  (Custom built Python's on Mac work like normal.)

All framework builds behave as you describe, Modules/getpath.c special- 
cases calculation of sys.prefix for framework builds of Python (the  
prefix is inside the framework regardless of where the executable is).

> Does anyone know a way to get the normal effect on this Mac Python?

You could copy the framework into the virtual python environment and  
rewrite linker commands in the python command-line executable to use  
that version of the framework.


> -- 
> Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org
>             : Write code, do good : http://topp.openplans.org/careers
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

More information about the Distutils-SIG mailing list