[Pythonmac-SIG] Apple Python using Fink Python's path?

Brian Lenihan brian_l at mac.com
Wed Apr 7 00:20:26 EDT 2004


On Apr 6, 2004, at 8:42 PM, Nicholas Riley wrote:

> I'd prefer not to have multiple Python versions installed, but I
> installed Fink Python 2.3.3 yesterday because some KDE packages
> require it.
>
> Today, I tried to use ipython, and Python claimed not to be able to
> find the package.  Any executable Python script I run now uses the
> Fink Python's sys.path, regardless of having #!/usr/bin/python or
> #!/System/Library/Frameworks/Python.framework/Versions/2.3/bin/python
> as the first line.  But if I run /usr/bin/python or the other one
> directly, sys.path is correctly set.  How can I stop this from
> happening?

This little C snippet illustrates the problem:

#include <stdio.h>
int main(int argc, char** argv) {
     int i;
     for (i=0; i<argc; i++)
         fprintf(stdout, "argv[%d]: \"%s\"\n", i, argv[i]);
     return(0);
}

OS X does not include the full path in argv[0].   I use a script to 
rename /sw/bin/python* when I don't want Fink's Python to interfere 
(and to move everything back when I need Fink Python).

I can send it to you if you'd like. 




More information about the Pythonmac-SIG mailing list