Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have installed python via mac ports, using:

sudo port install python33

I then did:

sudo port select --set python python33

and got:

Selecting 'python33' for 'python' succeeded. 'python33' is now active.

However when I do which python I get:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python

and for which python3 I get:

/Library/Frameworks/Python.framework/Versions/3.1/bin/python3

What have I done wrong?

When I do: port select --list python

I get:

Available versions for python:
    none
    python25-apple
    python33 (active)

When I do type -a python, I get:

python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python
python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python
python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python
python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python
python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python
python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python
python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python
python is /opt/local/bin/python
python is /usr/bin/python
python is /usr/local/bin/python

When I type: echo $PATH, I get:

/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.1/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/Library/Frameworks/Python.framework/Versions/3.2/bin:/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/usr/X11R6/bin
share|improve this question

1 Answer 1

which looks on the path to find the first python that itcan find. port select chnages /opt/local/bin/python to call the chosen python. For this to work /opt/local/bin has to be on the path before any other directory that contains python.

In your case you have /Library/Frameworks/Python.framework/Versions/2.7/bin and /Library/Frameworks/Python.framework/Versions/3.1/bin before /opt/local/bin.

You need to clean up your path. I would suggest starting from scratch and only adding directories that you know and understand. You seem yo have installed python in many ways and also have installed fink and macports. I would onlyuse one of the package managers and remove all the explicit python from the path.

share|improve this answer

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.