27

I'm using MacPorts and had installed python_select to switch between 2.6 and 2.7. But for some reason I'm now getting a "command not found" error when running:

sudo python_select python26 

Possibly an issue with $PATH? Not sure where to look for it.

wmfox3
  • 2,141
  • 4
  • 21
  • 28

3 Answers3

63

python_select isn't a command, it is a capability added to port select.

To use it:

  1. List the available pythons to select from:

    port select --list python
    
  2. to choose a specific port (eg python26):

    port select python python26
    


sudo make install
  • 5,629
  • 3
  • 36
  • 48
JackFrost
  • 631
  • 5
  • 4
  • 4
    python_select used to be a command - port select has now replaced it. – mmmmmm Feb 26 '12 at 13:19
  • i think you have to `sudo port select ...` and then probably run `sudo python` the first time so it can set itself up (unless your user has write access to `/opt`) – Seamus Abshere Sep 05 '14 at 18:16
7

See answer to subsequent reframing of question:

macports didn't place python_select in /opt/local/bin

Community
  • 1
  • 1
wmfox3
  • 2,141
  • 4
  • 21
  • 28
7

Eh, on my Lion, I use:-

$ sudo port select --list python

to see available python versions, and:-

$ sudo port select python python26

No _ necessary for me! YMMV

John Hall
  • 79
  • 1
  • 1
  • How does this improve or differ from the earlier [answer](http://stackoverflow.com/a/6885377/151019) – mmmmmm Jun 01 '14 at 11:34