How do I set macport python to be default?

nox n.oxyde at gmail.com
Tue Dec 22 15:11:24 PST 2009


Use python_select.

$ sudo port install python_select
...
$ python_select -l
Available versions:
current none python25 python26 python26-apple python31

Le 22 déc. 2009 à 23:28, S. Günther a écrit :

>> The correct answer appears to have something to do with the ordering in the PATH variable but this does not seem to work for me:
>> (On Snow Leopard - I have installed python from python.org and from Macports)
>> 
>> PATH=/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin
>> 
>> $ whereis python
>> /usr/bin/python
>> 
>> $ python
>> Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32)
>> [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
>> 
>> $ /opt/local/bin/python
>> Python 2.6.4 (r264:75706, Dec 21 2009, 20:23:10)
>> [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
>> 
> With your path variable set as above the MacPorts python should be found
> first. Which makes me suspect that PATH gets modified after set to the
> value above.
> You should check the output of:
> 
> echo $PATH
> 
> If that differs from the above setting check your bash startup scripts
> whether any of them modify the PATH after your setting takes place.
> On my system MacPython modified .bash_profile by prepending it's
> location onto the PATH thus overriding my own setting.
> 
> regards
> Stephan
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users



More information about the macports-users mailing list