0

I have Ubuntu 12.04 and Python 3.2 installed. When I use sudo apt-get install python3, it says that my python is 'already the newest version'. However, 3.4 is the latest.

How would I upgrade my current Python to 3.4?

2 Answers 2

0

As you noticed, Ubuntu 12.04 LTS ships with python3 3.2.3. If you need Python 3, then I suggest to upgrade to Ubuntu 14.04 LTS which includes python3 3.4.1.

If you cannot do that, consider something like virtualenv.

2
  • 2
    Surely there has to be a way of installing 3.4 without reinstalling the OS!
    – Beta Decay
    Aug 16, 2014 at 14:20
  • @BetaDecay Upgrade, not reinstall. Python 3 is a core component that is used by various parts of Ubuntu. Upgrading it system-wide may introduce breakage. The safest way is then to upgrade your current LTS to the next LTS version which is tested quite well. If you really want to keep your current version, have a look at virtualenv.
    – Lekensteyn
    Aug 16, 2014 at 18:00
0

You can build from source. Download the tarball from the Python-site.

$tar xvf Python-4.3.1.tgz
$cd Python-4.3.1
$less README

And follow the instructions. You will then have two different installations of python so by just entering $python -v you will invoke the old python version. This could be fixed by linking the new to your /etc/bin/python or whatever it links to. First you need to remove the old link and create a new.

$rm /etc/bin/openssl
$ln -s [PATH TO NEW PYTHON] /etc/bin/openssl

Now the new Python should be invoked, check with:

$python -v

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .