23

I've uninstalled and reinstalled python_select using MacPorts and yet it won't show up in /opt/local/bin. Consequently, I get a "command not found" error when attempting to run it. Yet MacPorts insists that it is installed. Have even tried uninstall -f and port clean --all python_select.

Is there a more drastic step to remove it from MacPorts and try installing again?

Brandon Zacharie
  • 2,320
  • 2
  • 24
  • 29
wmfox3
  • 2,141
  • 4
  • 21
  • 28

2 Answers2

28

It seems that python_select has been deprecated:

"python_select" (and other standalone *_select scripts) is gone.

Use "sudo port select python python26" etc.

Andy Hayden
  • 359,921
  • 101
  • 625
  • 535
wmfox3
  • 2,141
  • 4
  • 21
  • 28
11
sudo port select --set python python25

This will set the Python alias (/opt/local/bin/python) to python25

If you're not sure which versions of Python you have to select from, you can use:

$ port select --list python
Available versions for python:
    none
    python24
    python25-apple
    python26
    python26-apple
    python27 (active)

This shows you that python27 is selected, and that versions 25 & 26 have Apple specific versions (these are distributed with OS X).

Dana the Sane
  • 14,762
  • 8
  • 58
  • 80
Brandon Zacharie
  • 2,320
  • 2
  • 24
  • 29
  • How do you set the alias back to system python and not one of the versions installed by MacPorts? THanks! – defbyte Aug 10 '11 at 15:30
  • First, use "port select --list python" to see what versions of python you have installed. Use the command from this answer replacing "python25" with the version that you want that ends with "-apple" (i.e. you could use "python27-apple" if your an OS X Lion user). – Brandon Zacharie Aug 20 '11 at 01:43