python binary symlinks in Framework build

Adam Mercer ram at macports.org
Sat Jul 26 20:23:24 PDT 2008


Hi

In investigating a NumPy build problem I think I have found an issue
related to the python Framework builds. NumPy, and many other python
modules, use the python code os.path.basename(sys.executable) to
return the path to the current running executable for setting which
interpreter to use. This is $prefix/bin/python2.5, but as this is a
symlink to the Python binary within the framework directory
sys.executable is returning
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python
which will be shortened to simply Python after the basename call.

As $prefix/bin/Python is a symlink created by python_select this is
clearly going to cause problems if the default python interpreter is
changed with python_select.

Can anyone see a solution to this without having to heavily patch the
NumPy source?

Cheers

Adam


More information about the macports-dev mailing list