Skip to main content

USE_PYTHON in /etc/make.conf

Some packages in Gentoo support being installed for several Python versions at the same time. One of these packages is dev-python/pyinotify. If you look at the ebuild (file /usr/portage/dev-python/pyinotify/pyinotify-0.9.1.ebuild) you stumble upon these lines:


These lines tell that pyinotify 0.9.1 is expected to handle Python 2.5, 2.6, 2.7 and 3.0, 3.1, and 3.2. They are discussed in detail in the Gentoo Python Developers Guide. When installing pyinotify 0.9.1 with no USE_PYTHON line in /etc/make.conf by default you will get files for the active version of Python 2.x and Python 3.x. This line of the python eclass (file /usr/portage/eclass/python.eclass) is responsible:

PYTHON_ABIS="${python2_version} ${python3_version}"

There is three different active versions of python in Gentoo: one active version for 2.x and 3.x and third, a main active version from either pool, 2.6 in my case. These commands are meant to illustrate this:

# eselect python list --python2
Available Python 2 interpreters:
[1]   python2.6 *
[2]   python2.7

# eselect python list --python3
Available Python 3 interpreters:
[1]   python3.1 *

# eselect python list
Available Python interpreters:
[1]   python2.6 *
[2]   python2.7
[3]   python3.1

So with no specification of USE_PYTHON in /etc/make.conf I would get pyinotify installed for Python 2.6 and python 3.1. As I want to have support for Python 2.7 too, I have this line in my /etc/make.conf:

USE_PYTHON="2.6 2.7 3.1"

This is what it gets me:

# equery f dev-python/pyinotify | grep site-packages

NOTE : After changing USE_PYTHON, don't forget to run python-updater! It will rebuild packages that have too little (or too much) support for Python in its current form of installation. Besides, did I mention the Python team is lacking man and woman power?