Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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
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 '14 at 7:35
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 '14 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 '14 at 23:29

2 Answers 2

up vote 9 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 '14 at 5:16
@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 – muru Aug 28 '14 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. – Holloway Aug 28 '14 at 10:31

pyenv seems the way to go if you want to play with more than just the distribution's supplied version of Python 2.x and the supplied version of Python 3.x.

It let's you install many different Python versions side-by-side and choose between them. The installation happens inside a hidden directory in your home directory so you do not have to be root, you cannot disturb other people using other accounts (if there are any on your machine) and the "main" installation is always safe and secure and will not be changed or overridden in any way.

share|improve this answer

Your Answer


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.