setting default python26

Mark Hattam mark at dxradio.demon.co.uk
Sun Nov 6 15:25:38 PST 2011


Just did a selfupdate before list outdated

The following installed ports are outdated:
curl-ca-bundle                 7.22.0_0 < 7.22.0_1       
ffmpeg                         0.7.6_0 < 0.7.7_0         
python26                       2.6.7_1 < 2.6.7_2         
python27                       2.7.2_1 < 2.7.2_2         
x264                           20110628_0 < 20111023_0   

Fair enough, upgrade them all ... python27 printed

--->  Activating python27 @2.7.2_2
To make python 2.7 the default (i.e. the version you get when you run 'python'), please run:
    	sudo port select --set python python27


then python26 printed

--->  Activating python26 @2.6.7_2
To make python 2.6 the default (i.e. the version you get when you run 'python'), please run:
    	sudo port select --set python python26


OK ... so which should I select? Well, "I" don't run python, but other installed things do ... let's see what dependents there are on my machine ...

iMac:~ $ port dependents python26
getmail depends on python26
xorg-xcb-proto depends on python26

iMac:~ $ port dependents python27
python27 has no dependents.


Ah, so python27 must be a hangover from something else, hence I can get rid of it, so uninstall it.

iMac:~ $ sudo port uninstall python27
--->  Deactivating python27 @2.7.2_2
--->  Cleaning python27
--->  Uninstalling python27 @2.7.2_2
--->  Cleaning python27


So far so good. Now try and set python26 to be the default ... using the printed statement above ...

iMac:~ $ sudo port select --set python python26
Selecting 'python26' for 'python' failed: symlink: /opt/local/etc/select/python/current -> python26: file already exists

Hmmm ... not so good ... so go look ...

iMac:~ $ ls -l /opt/local/etc/select/python/
total 48
-rw-r--r--  1 root  admin  363 13 May 22:15 base
lrwxr-xr-x  1 root  admin    8 13 Jan  2011 current -> python27
-rw-r--r--  1 root  admin   26 13 May 22:15 none
-rw-r--r--  1 root  admin  153 13 May 22:15 python25-apple
-rw-r--r--  1 root  admin  398  6 Nov 03:06 python26
-rw-r--r--  1 root  admin  183 13 May 22:15 python26-apple

So there is a link ... that points to python27 which I've now uninstalled, and the port select command can't overwrite it, even sudo'd ...

So rename "current" to "was_current", try again ...

iMac:~ $ sudo port select --set python python26
Selecting 'python26' for 'python' succeeded. 'python26' is now active.

iMac:~ $ ls -l /opt/local/etc/select/python/*current
total 56
lrwxr-xr-x  1 root  admin    8  6 Nov 22:52 current -> python26
lrwxr-xr-x  1 root  admin    8 13 Jan  2011 was_current -> python27


Now all happy.


Mark





More information about the macports-users mailing list