Installing newest Python on openSUSE

clstaudt picture clstaudt · Sep 18, 2013 · Viewed 30.1k times · Source

I installed Python on an openSUSE system (see version below) using the Zypper package manager. This gives me Python 3.2, but some packages require Python 3.3. Updating with zypper update python3 stays on Python 3.2. How can I upgrade to 3.3, ideally using the package manager and reusing the rest of my working Python installation (site packages, pip...)?

openSUSE 12.2 (x86_64)
VERSION = 12.2
CODENAME = Mantis

Answer

TobiMarg picture TobiMarg · Sep 18, 2013

You can add the devel:languages:python:Factory repository or use the 1 Click Install and a Python 3.3.2 version form here (e.g. from the above repo).
(Show other versions->openSUSE 12.2->Show unstable packages->1 Click Install)

To use it with zypper only (no GUI) you can add the repo as follows:

sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/python:/Factory/openSUSE_12.2/devel:languages:python:Factory.repo

Then, to use packages from that repo you should give the repo a higher priority (in this case higher priority means lower number 0=high, 100=low). To know the repo id use zypper lr and search for the repo number in the output. Then use the following command to change the priority:

 sudo zypper mr -p priority repo_number

You could use e.g. 50 as priority if your other repos have the standard priority of 99.
Then use zypper update python3 to update python.