Linux – How to choose Python version to install in Gentoo

gentoolinuxpackage-managementpython

I'm using Gentoo Linux and i want to install Python2.5 but there is a problem.

The command, emerge -av python outputs the following,

    These are the packages that would be merged, in order:

    Calculating dependencies... done!
    [ebuild     U ] dev-lang/python-3.1.2-r3 [3.1.1-r1] USE="gdbm ipv6 ncurses readline ssl threads (wide-unicode%*) xml -build -doc -examples -sqlite* -tk -wininst (-ucs2%)" 9,558 kB
    [ebuild     U ] app-admin/python-updater-0.8 [0.7] 8 kB

and there are ebuilds for more versions:

    # ls /usr/portage/dev-lang/python
    ChangeLog  
    files  
    Manifest  
    metadata.xml  
    python-2.4.6.ebuild  
    python-2.5.4-r4.ebuild  
    python-2.6.4-r1.ebuild  
    python-2.6.5-r2.ebuild  
    python-3.1.2-r3.ebuild

How to choose ebuild that I want? (python-2.5.4-r4)

updated

@Ophidian emerge -av =python-2.5.4-r4 works.. Thanks

Best Answer

I believe Python is slotted, so you should be able to have multiple versions co-exist without issues.

You can emerge a specific version simply by specifying the version you want thusly:

emerge -av =python-2.5.4-r4

or with newer portage versions, by slot name rather than version #:

emerge -av python:2.5

Some links you might find helpful: