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

Nicholas Riley njriley at uiuc.edu
Tue Apr 6 23:42:27 EDT 2004


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?

% echo "#\!/usr/bin/python\n\nimport sys;print sys.version;print sys.path" > foo; chmod +x foo
% ./foo
2.3 (#1, Sep 13 2003, 00:49:11) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)]
['/Users/nicholas', '/sw/lib/python23.zip', '/sw/lib/python2.3', '/sw/lib/python2.3/plat-darwin', '/sw/lib/python2.3/plat-mac', '/sw/lib/python2.3/plat-mac/lib-scriptpackages', '/sw/lib/python2.3/lib-tk', '/sw/lib/python2.3/lib-dynload', '/sw/lib/python2.3/site-packages']
% /usr/bin/python -c 'import sys;print sys.version;print sys.path'
2.3 (#1, Sep 13 2003, 00:49:11) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)]
['/Users/nicholas', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/Numeric', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PIL', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PyObjC', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/foop']
% echo "#\!/sw/bin/python\n\nimport sys;print sys.version;print sys.path" > bar; chmod +x bar
% ./bar
2.3.3 (#1, Mar 12 2004, 23:21:41) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)]
['/Users/nicholas', '/sw/lib/python23.zip', '/sw/lib/python2.3', '/sw/lib/python2.3/plat-darwin', '/sw/lib/python2.3/plat-mac', '/sw/lib/python2.3/plat-mac/lib-scriptpackages', '/sw/lib/python2.3/lib-tk', '/sw/lib/python2.3/lib-dynload', '/sw/lib/python2.3/site-packages']

-- 
=Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>



More information about the Pythonmac-SIG mailing list