Gentoo Logo

Gentoo Python Multiple ABI Guide


1.  Introduction

Recent changes to the Python eclass have added the capability to Portage to install and manage multiple simultaneous python installations. This functionality can be especially useful to those requiring support for both Python-2 and Python-3, and additionally support for multiple major versions of Python-2 and/or Python-3. What this means is that the user can install any supported version of Python at the same time and have Portage automatically build your packages for all installed versions of Python assuming, of course, that the package itself supports it. Whats more, this capability is all managed from the comfort of the well know file /etc/make.conf.

For developers and interested users wishing to learn more about how this is implemented please refer to the Gentoo Python Developers Guide

Note: Please be aware that this functionality is not dependent on your active python versions as chosen by using eselect python.

2.  Usage

The usage of this new capability is quite simple. Just fire up your favorite editor and load /etc/make.conf. Shown below is an example of the usage of the new variable USE_PYTHON.

Code Listing 2.1: Adding USE_PYTHON to /etc/make.conf

# Please consult /etc/make.conf.example for a more detailed example.
CFLAGS="-march=amdfam10 -O2 -pipe"
USE_PYTHON="2.5 2.6 2.7 3.0 3.1"

Important: Once you have added USE_PYTHON to your /etc/make.conf you must run python-updater.

Warning: Some packages are not yet ready to support multiple python ABIs, so your mileage may vary.


Page updated December 3, 2010

Summary: This guide explains and demonstrates the use of multiple simultaneous python versions or ABIs in Gentoo Linux.

Matthew Summers

Donate to support our development efforts.

Copyright 2001-2015 Gentoo Foundation, Inc. Questions, Comments? Contact us.