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 looking to pick up some programming skills and after looking into it a bit, I came across an article that recommended that I learn Python as a way of getting started at programming before moving on to other languages. I realize Python 2.x.x is preinstalled in Ubuntu, but I was wondering if it's possible to upgrade to Python 3.x.x as the site's documentation seems to indicate that 3.x.x is where the language is going in the future.

Failing that, how do I update Python 2.7.6 to 2.7.8?

share|improve this question
1  
If you are just starting with programming the python version will not make any difference, just use what you have installed. –  Robot Mess Aug 28 at 7:35
1  
For the benefit of those new to Python: The difference from 2.7.6 to 2.7.8 or 3.4.0 to 3.4.1 is not likely to matter much for you (and I think that's what Robot Mess means. But Python 2.y.z and Python 3.y.z are quite different languages. Even a typical Python 2 hello world program won't run with Python 3 as the interpreter. –  Eliah Kagan Aug 28 at 12:56
    
@EliahKagan This. Very good point. Besides the answer should be an answer to the question. Because I, who have programmed Python in the past am looking at how to install Python 3.3 on Kubuntu 14.04 (too) so I can learn Django using the latest code base. –  BillR Nov 24 at 23:29

1 Answer 1

up vote 7 down vote accepted

According to the package listing, Ubuntu 14.04 comes with Python 3.4 installed by default. Run python3 if you want python3.x.x (or python3.4 if you want python3.4.x).

Until most components have been migrated to Python 3, both 2.7.x and 3.x will be available on Ubuntu, with python being python2.

Python 2.7.8 isn't available in the official repositories. However, there's a PPA available: Old and New Python versions. See What are PPAs and how do I use them? to understand how to use PPAs. Also note that while the version in Ubuntu 14.04 may remain 3.4.0 for sometime, the devs will be backporting fixes from 3.4.1.

share|improve this answer
    
Great! I have 3.4.0. Would it be necessary to update to 3.4.1 (the latest version)? How would I go about that? –  Lucas W Aug 28 at 5:16
1  
@LucasW Unless you're programming on the cutting edge of Python, nope. If you do want to, you might have to compile from source. The PPA linked in the updated answer doesn't even have it. Also see askubuntu.com/q/474108/158442 –  muru Aug 28 at 5:18
    
If you want to exclusively use python3, you could alias python3 as python. You could still run python2 if you wanted it (or call /usr/bin/python directly) but by default it would use python3. I found it was easier to change than messing around with alternatives. –  Trengot Aug 28 at 10:31

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.