Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using 13.04, I can access python3.3 via python3. bu i want to make the default interpreter to python3.3. simple python takes me to python 2.7.4. How to upgrade?

share|improve this question
3  
Just a warning: Do not attempt to change the /usr/bin/python symlink to point to python3 instead of 2.7. Many programs available in the Ubuntu repos require /usr/bin/python to be compatible to python 2.x. –  soulsource Jul 17 '13 at 8:17
    
@soulsource, yeah I'm aware of that. that's why i asked is there an "upgrade" option available or not. –  Giri Jul 17 '13 at 8:24
    
I think the answer by Radu Rădeanu is already quite close to the optimal solution. It only applies to one user, and is only in effect for directly running python typing the python command, not affecting programs with a #!/usr/bin/python shebang. –  soulsource Jul 17 '13 at 8:44
1  
Ah, now I got what you meant with upgrade... Actually the Ubuntu developers are working on that: wiki.ubuntu.com/Python/3 "It is a release goal for Ubuntu 14.04 LTS to have only Python 3 on the desktop CD images." –  soulsource Jul 17 '13 at 8:45
    
@soulsource that's what I'm searching for! :) thanks! –  Giri Jul 17 '13 at 9:36
add comment

2 Answers

up vote 6 down vote accepted

A simple safety way would be to use an alias, by placing:

alias python=python3

into ~/.bashrc or ~/.bash_aliases file.

python

share|improve this answer
    
so no "upgrade" option..?? –  Giri Jul 17 '13 at 8:14
    
@Giri You said that you have python3. What for an upgrade? –  Radu Rădeanu Jul 17 '13 at 8:16
    
actually i want to wipe-out 2.7 and replace it with 3.3. Seems like its a bad idea for now.. –  Giri Jul 17 '13 at 8:26
3  
+1 there is no reason to purge 2.7 in order to be able to work with 3.3. As lots of software still depends on 2.7; just keep it lingering around. –  don.joey Jul 17 '13 at 9:39
add comment

You can use update-alternatives to provide different versions of programs that may be needed at different times due to compatibility issues.

This answer Is a good example for how to set things up for simultaneously maintaining different versions of gcc/g++, for example.

just do the same with python2.7 and python 3.3

share|improve this answer
    
Beginning users may not be able to easily adapt the linked answer to a different situation. In addition to crediting the earlier answer, it would be good to lay out the steps needed for Python. –  chaskes Oct 18 '13 at 14:47
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.