Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Mac which uses MacPorts to have multiple versions of Python installed and use the python_select application to switch between them.

Currently, this Mac has OS 10.6.6, which comes with Python 2.6.1 installed as /usr/bin/python. Using MacPorts, I've installed the python27, python31, and python_select ports and now have this issue: python_select seems to not be switching the default python properly:

$ which python
/usr/bin/python
$ python -V
Python 2.6.1
$ /usr/bin/python -V
Python 2.6.1
$ sudo python_select python27
Selecting version "python27" for python
$ which python
/opt/local/bin/python
$ ls -l /opt/local/bin/python
lrwxr-xr-x  1 root  admin    24B Mar 18 10:24 /opt/local/bin/python -> /opt/local/bin/python2.7
$ python -V
Python 2.6.1           # <-- Wrong!!!
$ /opt/local/bin/python -V
Python 2.7.1           # <-- Why are you not default?

So, after running python_select, which python seems to think that the /opt/local/bin version is going to be used, but in reality, it seems that the /usr/bin one is taking precedent unless I specifically call the /opt/local/bin one.

Is there something I'm doing wrong?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This question is perfectly answered in the response to a StackOverflow question:

How to make Python select work for python command

share|improve this answer
    
Thank you! I had an extra PATH append in my bash_profile that was throwing it off. –  MidnightLightning Mar 18 '11 at 15:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.