5

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?

muru
  • 207,228
Lucas W
  • 465

3 Answers3

10

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.

muru
  • 207,228
2

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.

https://github.com/yyuu/pyenv#installation

Peter Lund
  • 21
  • 1
0

Besides pyenv (as Peter Lund suggests), or a PPA (as muru suggests), or building from source and installing into /usr/local, if you decide you need another version of Python 3, you can use Conda (which is now suggested by the maintainer of that PPA).

Like pyenv, Conda facilitates creating and managing multiple separate Python installations on the same system. You'll likely want to choose Anaconda over Miniconda if you haven't used Conda before. (If you have used Conda before, then you may still often choose Anaconda; the choice is then a technical one made mainly based on the nature of your specific task.)

The Anaconda installer is available here. For more information on Anaconda, I recommend:

Eliah Kagan
  • 119,640