Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have installed both python3.3 and python2.6. I have set python3.3 to default by creating an alias named "python" in usr/bin and another one for python2.6 named "python2.6". Now if I type in the terminal "python" python3.3 will be open but if I type "python2.6" I get "cannot execute binary file". I can launch the binary directly but not through the alias. I have checked the permissions and are the same for both binaries and aliases so I don't know what to do. Can someone help me?

share|improve this question
1  
Did you create aliases (in Finder) or symbolic links (in Terminal)? Can you execute the python2.6 binary in its installation directory directly? –  patrix Feb 3 '13 at 16:32
    
Aliases using finder and yes, I can run python 2.6 from the original folder without problems. –  Rnhmjoj Feb 3 '13 at 16:40
1  
I would recommend using symbolic links for this instead of aliases –  patrix Feb 3 '13 at 16:48
    
I created a link using "ln" and it's working. Thank you. –  Rnhmjoj Feb 3 '13 at 17:02
add comment

1 Answer 1

up vote 4 down vote accepted

Instead of using Finder aliases, use Terminal to create symbolic links (see man ls for details):

ln -s /path/to/python3.3/binary /usr/local/bin/python
ln -s /path/to/python2.6/binary /usr/local/bin/python2.6

It's usually not a good idea to mess with /usr/bin content (will be wiped out with the next upgrade). Use /usr/local/bin instead and make sure it comes before /usr/bin in $PATH.

share|improve this answer
    
Ok, thanks again. –  Rnhmjoj Feb 3 '13 at 17:09
add comment

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.