Python Modules

Introduction to Python Modules

The Python module packages add useful objects to the Python language. Modules utilized by packages throughout BLFS are listed here, along with their dependencies. Installation of the modules shown on this page is meant to follow from top to bottom to handle optional dependencies in each module.

D-Bus Python

Introduction to D-Bus Python Module

D-Bus Python provides Python bindings to the D-Bus.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

D-Bus Python Dependencies

Required

dbus-glib-0.106 and Python-2.7.12 and/or Python-3.5.2

Optional (Required to build the API and HTML Documentation)

Epydoc and Docutils

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/dbus-python

Installation of D-Bus Python

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To build D-Bus Python as the Python 2 module, run the following commands:

mkdir python2 &&
pushd python2 &&
PYTHON=/usr/bin/python     \
../configure --prefix=/usr --docdir=/usr/share/doc/dbus-python-1.2.4 &&
make &&
popd

To test the results, issue: make -C python2 check.

To build D-Bus Python as the Python 3 module, run the following commands:

mkdir python3 &&
pushd python3 &&
PYTHON=/usr/bin/python3    \
../configure --prefix=/usr --docdir=/usr/share/doc/dbus-python-1.2.4 &&
make &&
popd

To test the results, issue: make -C python3 check.

To install the Python 2 module, run the following command as the root user:

make -C python2 install

To install the Python 3 module, run the following command as the root user:

make -C python3 install

Contents

Installed Programs: None
Installed Libraries: None
Installed Directories: /usr/share/doc/dbus-python-1.2.4 and /usr/lib/python2.7/site-packages/dbus and/or /usr/lib/python3.5/site-packages/dbus

PyAtSpi2-2.20.2

Introduction to PyAtSpi2

The PyAtSpi2 package contains Python bindings for the core components of the GNOME Accessibility.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

PyAtSpi2 Dependencies

Required

PyGObject-3.20.1

Recommended

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/pyatspi2

Installation of PyAtSpi2

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To build PyAtSpi2 as the Python 2 module, run the following commands:

mkdir python2 &&
pushd python2 &&
../configure --prefix=/usr --with-python=/usr/bin/python &&
make &&
popd

To build PyAtSpi2 as the Python 3 module, run the following commands:

mkdir python3 &&
pushd python3 &&
../configure --prefix=/usr --with-python=/usr/bin/python3 &&
make &&
popd

This package does not come with a testsuite.

To install the Python 2 module, run the following command as the root user:

make -C python2 install

To install the Python 3 module, run the following command as the root user:

make -C python3 install

Contents

Installed Programs: None
Installed Libraries: None
Installed Directories: /usr/lib/python2.7/site-packages/pyatspi and/or /usr/lib/python3.5/site-packages/pyatspi

Py2cairo-1.10.0

Introduction to Py2cairo Module

Py2cairo provides Python 2 bindings to Cairo.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

Py2cairo Dependencies

Required

Python-2.7.12 and Cairo-1.14.6

Optional

pytest

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/py2cairo

Installation of Py2cairo

Install Py2cairo by running the following commands:

./waf configure --prefix=/usr &&
./waf build

The test suite must be run after the package is installed.

Now, as the root user:

./waf install

The test suite requires the optional pytest package. If installed, it is run by changing to the test directory and running py.test as an unprivileged user.

Contents

Installed Programs: None
Installed Library: _cairo.so
Installed Directory: /usr/include/pycairo and /usr/lib/python2.7/site-packages/cairo

PyCairo-1.10.0

Introduction to PyCairo Module

PyCairo provides Python 3 bindings to Cairo.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

Additional Downloads

PyCairo Dependencies

Required

Cairo-1.14.6 and Python-3.5.2

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/pycairo

Installation of PyCairo

Install PyCairo by running the following commands:

patch -Np1 -i ../pycairo-1.10.0-waf_unpack-1.patch     &&
wafdir=$(./waf unpack) &&
pushd $wafdir          &&
patch -Np1 -i ../../pycairo-1.10.0-waf_python_3_4-1.patch &&
popd                   &&
unset wafdir           &&
PYTHON=/usr/bin/python3 ./waf configure --prefix=/usr  &&
./waf build

This package does not come with a test suite.

Now, as the root user:

./waf install

Contents

Installed Programs: None
Installed Library: None
Installed Directory: /usr/include/pycairo and /usr/lib/python3.5/site-packages/cairo

PyGObject-2.28.6

Introduction to PyGObject Module

PyGObject-2.28.6 provides Python 2 bindings to the GObject class from GLib.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

Additional Downloads

PyGObject Dependencies

Required

GLib-2.48.2 and Py2cairo-1.10.0

Optional

gobject-introspection-1.48.0 and libxslt-1.1.29 (to Build Documentation)

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/pygobject2

Installation of PyGObject

Install PyGObject by running the following commands:

patch -Np1 -i ../pygobject-2.28.6-fixes-1.patch   &&
sed -i "/seems to be moved/s/^/#/" ltmain.sh &&
./configure --prefix=/usr --disable-introspection &&
make

This package does not have a working testsuite.

Now, as the root user:

make install

Command Explanations

sed -i ... ltmain.sh: This sed silences several useless and annoying warnings generated by libtool.

--disable-introspection: Omit this switch if you have installed gobject-introspection-1.48.0. Note that it conflicts with PyGObject-3.20.1.

--disable-docs: This option disables the rebuilding of the html documentation if libxslt-1.1.29 is installed.

Contents

Installed Programs: pygobject-codegen-2.0
Installed Libraries: libpyglib-2.0-python.so, _gio.so, unix.so, _glib.so and _gobject.so.
Installed Directories: /usr/include/pygtk-2.0, /usr/lib/python2.7/site-packages/gtk-2.0/{gio,glib,gobject}, /usr/share/gtk-doc/html/pygobject and /usr/share/pygobject/2.0

PyGObject-3.20.1

Introduction to PyGObject3 Module

PyGObject3 provides Python bindings to the GObject class from GLib.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

PyGObject3 Dependencies

Required

gobject-introspection-1.48.0 and Py2cairo-1.10.0 (for Python 2 bindings) and/or PyCairo-1.10.0 (for Python 3 bindings)

Optional (for the tests)

pep8 and pyflakes

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/pygobject3

Installation of PyGObject3

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To build PyGObject3 as the Python 2 module, run the following commands:

mkdir python2 &&
pushd python2 &&
../configure --prefix=/usr --with-python=/usr/bin/python &&
make &&
popd

To test the results, issue: make -C python2 check. An already active graphical session with bus address is necessary to run the tests.

To build PyGObject3 as the Python 3 module, run the following commands:

mkdir python3 &&
pushd python3 &&
../configure --prefix=/usr --with-python=/usr/bin/python3 &&
make &&
popd

To test the results, issue: make -C python3 check. An already active graphical session with bus address is necessary to run the tests.

To install the Python 2 module, run the following command as the root user:

make -C python2 install

To install the Python 3 module, run the following command as the root user:

make -C python3 install

Contents

Installed Programs: None
Installed Library: /usr/lib/python2.7/site-packages/gi/_gi{,_cairo}.so and/or /usr/lib/python3.5/site-packages/gi/_gi{,_cairo}.cpython-35m-<arch>-linux-gnu.so
Installed Directories: /usr/include/pygobject-3.0, and /usr/lib/python2.7/site-packages/{gi,pygtkcompat} and/or /usr/lib/python3.5/site-packages/{gi,pygtkcompat}

PyGTK-2.24.0

Introduction to PyGTK Module

PyGTK lets you to easily create programs with a graphical user interface using the Python programming language.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

PyGTK Dependencies

Required

PyGObject-2.28.6

Required (atk module)

ATK-2.20.0

Required (pango module)

Pango-1.40.1

Required (pangocairo module)

Py2cairo-1.10.0 and Pango-1.40.1

Required (gtk and gtk.unixprint modules)

Py2cairo-1.10.0 and GTK+-2.24.30.

Required (gtk.glade module)

Py2cairo-1.10.0 and libglade-2.6.4.

Optional

NumPy

Optional (to Build Documentation)

libxslt-1.1.29

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/pygtk

Installation of PyGTK

Install PyGTK by running the following commands:

./configure --prefix=/usr &&
make

The tests must be run from an active X display. If this is so, issue: make check.

Now, as the root user:

make install

Command Explanations

--enable-docs: This option enables rebuilding the html documentation if libxslt-1.1.29 is installed.

Contents

Installed Programs: pygtk-codegen-2.0 and pygtk-demo.
Installed Libraries: atk.so, _gtk.so, glade.so, gtkunixprint.so, pango.so and pangocairo.so.
Installed Directories: /usr/include/pygtk-2.0, /usr/lib/pygtk, /usr/lib/python2.7/site-packages/gtk-2.0, /usr/share/gtk-doc/html/pygtk and /usr/share/pygtk.

Short Descriptions

pygtk-codegen-2.0

is a wrapper script to run the PyGTK codegen module.

pygtk-demo

is a Python wrapper to run the PyGTK demo program.

PyXDG-0.25

Introduction to PyXDG Module

PyXDG is a Python library to access freedesktop.org standards.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

PyXDG Dependencies

Required

Python-2.7.12 and/or Python-3.5.2

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/pyxdg

Installation of PyXDG

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To install the Python 2 module, run the following command as the root user:

python setup.py install --optimize=1

To install the Python 3 module, run the following command as the root user:

python3 setup.py install --optimize=1

Contents

Installed Directory: /usr/lib/python2.7/site-packages/xdg and/or /usr/lib/python3.5/site-packages/xdg

Setuptools-26.1.0

Introduction to Setuptools Module

Setuptools is a Python module that makes it easier to download, build, install, upgrade, and uninstall Python packages.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

Setuptools Dependencies

Required

Python-2.7.12 and/or Python-3.5.2

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/setuptools

Installation of Setuptools

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To install the Python 2 module, run the following command as the root user:

python setup.py install --optimize=1

To install the Python 3 module, run the following command as the root user:

python3 setup.py install --optimize=1

Contents

Installed Programs: easy_install, easy_install-2.7, and easy_install-3.5
Installed Libraries: None
Installed Directories: /usr/lib/python2.7/site-packages/_markerlib, /usr/lib/python2.7/site-packages/setuptools, /usr/lib/python2.7/site-packages/setuptools-26.1.0-py2.7.egg-info and/or /usr/lib/python3.5/site-packages/_markerlib, /usr/lib/python3.5/site-packages/setuptools, /usr/lib/python3.5/site-packages/setuptools-26.1.0-py3.5.egg-info

Beaker-1.8.0

Introduction to Beaker Module

Beaker is a Python module that implements caching and sessions WSGI middleware for use with web applications and stand-alone Python scripts and applications.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

Beaker Dependencies

Required

Setuptools-26.1.0

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/Beaker

Installation of Beaker

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To install the Python 2 module, run the following command as the root user:

python setup.py install --optimize=1

To install the Python 3 module, run the following command as the root user:

python3 setup.py install --optimize=1

Contents

Installed Programs: None
Installed Libraries: None
Installed Directories: /usr/lib/python2.7/site-packages/beaker, /usr/lib/python2.7/site-packages/Beaker-1.8.0-py2.7.egg-info and/or /usr/lib/python3.5/site-packages/beaker, /usr/lib/python3.5/site-packages/Beaker-1.8.0-py3.5.egg-info

MarkupSafe-0.23

Introduction to MarkupSafe Module

MarkupSafe is a Python module that implements a XML/HTML/XHTML Markup safe string.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

MarkupSafe Dependencies

Required

Setuptools-26.1.0

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/MarkupSafe

Installation of MarkupSafe

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To build the Python 2 module, run the following command:

python setup.py build

To install the Python 2 module, run the following command as the root user:

python setup.py install --optimize=1

To build the Python 3 module, run the following command:

python3 setup.py build

To install the Python 3 module, run the following command as the root user:

python3 setup.py install --optimize=1

Contents

Installed Programs: None
Installed Libraries: None
Installed Directories: /usr/lib/python2.7/site-packages/markupsafe, /usr/lib/python2.7/site-packages/MarkupSafe-0.23-py2.7.egg-info and/or /usr/lib/python3.5/site-packages/markupsafe, /usr/lib/python3.5/site-packages/MarkupSafe-0.23-py3.5.egg-info

Jinja2-2.8

Introduction to Jinja2 Module

Jinja2 is a Python module that implements a simple pythonic template language.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

Jinja2 Dependencies

Required

MarkupSafe-0.23

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/Jinja2

Installation of Jinja2

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To install the Python 2 module, run the following command as the root user:

python setup.py install --optimize=1

To install the Python 3 module, run the following command as the root user:

python3 setup.py install --optimize=1

Contents

Installed Programs: None
Installed Libraries: None
Installed Directories: /usr/lib/python2.7/site-packages/Jinja2, /usr/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg-info and/or /usr/lib/python3.5/site-packages/Jinja2, /usr/lib/python3.5/site-packages/Jinja2-2.8-py3.5.egg-info

Mako-1.0.4

Introduction to Mako Module

Mako is a Python module that implements hyperfast and lightweight templating for the Python platform.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

Mako Dependencies

Required

Beaker-1.8.0 and MarkupSafe-0.23

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/Mako

Installation of Mako

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To install the Python 2 module, run the following command as the root user:

python setup.py install --optimize=1

To install the Python 3 module, run the following command as the root user:

sed -i "s:mako-render:&3:g" setup.py &&
python3 setup.py install --optimize=1

Command Explanations

sed -i "s:mako-render:&3:g" setup.py: This sed prevents setup.py from overwriting an already installed script by the Python 2 module. Remove it if you are building this module only for Python 3.

Contents

Installed Programs: mako-render and/or mako-render3
Installed Libraries: None
Installed Directories: /usr/lib/python2.7/site-packages/mako, /usr/lib/python2.7/site-packages/Mako-1.0.4-py2.7.egg-info and/or /usr/lib/python3.5/site-packages/mako, /usr/lib/python3.5/site-packages/Mako-1.0.4-py3.5.egg-info

PyYAML-3.11

Introduction to PyYAML Module

PyYAML is a Python module that implements the next generation YAML parser and emitter.

This package is known to build and work properly using an LFS-7.10 platform.

Package Information

PyYAML Dependencies

Required

Python-2.7.12 and/or Python-3.5.2 and YAML-0.1.6

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/PyYAML

Installation of PyYAML

[Note]

Note

Both Python 2 and Python 3 modules can be built and installed without any conflicts.

To build the Python 2 module, run the following command:

python setup.py build

To install the Python 2 module, run the following command as the root user:

python setup.py install --optimize=1

To build the Python 3 module, run the following command:

python3 setup.py build

To install the Python 3 module, run the following command as the root user:

python3 setup.py install --optimize=1

Contents

Installed Programs: None
Installed Libraries: _yaml.so
Installed Directories: /usr/lib/python2.7/site-packages/yaml and/or /usr/lib/python3.5/site-packages/yaml,

Last updated on 2016-06-05 20:35:53 -0700