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-1.2.8

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-8.3 platform.

Package Information

D-Bus Python Dependencies

Required

dbus-1.12.10 and GLib-2.56.1

Optional

Python-2.7.15 and tap.py (required for tests)

Optional (Required to build the API and HTML Documentation)

docutils-0.14 and Sphinx

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.8 &&
make &&
popd

To test the results, issue: make -C python2 check. One test reports error due to dbus issues.

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.8 &&
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.8 and /usr/lib/python2.7/site-packages/dbus and/or /usr/lib/python3.7/site-packages/dbus

docutils-0.14

Introduction to docutils

docutils is a set of Python modules and programs for processing plaintext docs into formats such as HTML, XML, or LaTeX.

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

Package Information

Docutils Dependencies

Recommended
[Note]

Note

This package can be installed with Python 3, but some packages require Python 2.

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

Installation of docutils

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

python setup.py build

To install the Python applications run the following as the root user:

python setup.py install --optimize=1 &&

for f in /usr/bin/rst*.py; do
  ln -svf $(basename $f) /usr/bin/$(basename $f .py)
done

Contents

Installed Programs: rst2html4, rst2html5, rst2html, rst2latex, rst2man, rst2odt_prepstyles, rst2odt, rst2pseudoxml, rst2s5, rst2xetex, rst2xml, and rstpep2html
Installed Libraries: None
Installed Directories: /usr/lib/python3.7/site-packages/docutils

PyAtSpi2-2.26.0

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-8.3 platform.

Package Information

PyAtSpi2 Dependencies

Required

PyGObject-3.28.3

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.7/site-packages/pyatspi

PyCairo-1.17.1

Introduction to PyCairo Module

PyCairo provides Python bindings to Cairo.

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

Package Information

PyCairo Dependencies

Required

Cairo-1.14.12

Optional

Python-2.7.15 and Hypothesis (for tests)

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

Installation of PyCairo

Install PyCairo for Python2 by running the following commands:

python2 setup.py build

This package does not come with a test suite.

Now, as the root user:

python2 setup.py install --optimize=1   &&
python2 setup.py install_pycairo_header &&
python2 setup.py install_pkgconfig

Install PyCairo for Python3 by running the following commands:

python3 setup.py build

This package does not come with a test suite.

Now, as the root user:

python3 setup.py install --optimize=1   &&
python3 setup.py install_pycairo_header &&
python3 setup.py install_pkgconfig

Contents

Installed Programs: None
Installed Libraries: _cairo.so (python2) and _cairo.cpython-36m-x86_64-linux-gnu.so (python3)
Installed Directories: /usr/lib/python2.7/site-packages/cairo and /usr/lib/python3.7/site-packages/cairo

PyCrypto-2.6.1

Introduction to the PyCrypto Module

PyCrypto is a collection of both secure hash functions (such as SHA256 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.).

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

Package Information

PyCrypto Dependencies

Optional

Python-2.7.15

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

Installation of PyCrypto

[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: pycrypto-2.6.1-py2.7.egg-info and/or pycrypto-2.6.1-py3.6.egg-info
Installed Directories: /usr/lib/python2.7/site-packages/Crypto and/or /usr/lib/python3.7/site-packages/Crypto

PyGObject-2.28.7

Introduction to PyGObject Module

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

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

Package Information

PyGObject Dependencies

Required

GLib-2.56.1 and PyCairo-1.17.1 (Python 2)

Optional

gobject-introspection-1.56.1 and libxslt-1.1.32 (to Build Documentation)

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

Installation of PyGObject

Install PyGObject by running the following commands:

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

This package does not have a working testsuite.

Now, as the root user:

make install

Command Explanations

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

--disable-docs: This option disables the rebuilding of the html documentation if libxslt-1.1.32 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.28.3

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-8.3 platform.

Package Information

PyGObject3 Dependencies

Required

gobject-introspection-1.56.1 and PyCairo-1.17.1 (for Python 2 and/or 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.7/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.7/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-8.3 platform.

Package Information

PyGTK Dependencies

Required

PyGObject-2.28.7

Required (atk module)

ATK-2.29.2

Required (pango module)

Pango-1.42.3

Required (pangocairo module)

PyCairo-1.17.1 (Python 2) and Pango-1.42.3

Required (gtk and gtk.unixprint modules)

PyCairo-1.17.1 (Python 2) and GTK+-2.24.32.

Required (gtk.glade module)

PyCairo-1.17.1 (Python 2) and libglade-2.6.4.

Optional

NumPy

Optional (to Build Documentation)

libxslt-1.1.32

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.32 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-8.3 platform.

Package Information

PyXDG Dependencies

Optional

Python-2.7.15

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.7/site-packages/xdg

funcsigs-1.0.2

Introduction to the funcsigs Module

funcsigs is a is a backport of the PEP 362 function signature features from Python 3.3's inspect module for Python 2.x.

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

Package Information

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

Installation of funcsigs

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

python setup.py install --optimize=1
[Note]

Note

This module is included with Python distributions after 3.3.

Contents

Installed Programs: None
Installed Libraries: None
Installed Directories: /usr/lib/python2.7/site-packages/funcsigs-1.0.2-py2.7.egg-info

Beaker-1.10.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-8.3 platform.

Package Information

Beaker Dependencies

Optional

funcsigs-1.0.2 (required for Python-2.7)

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.10.0-py2.7.egg-info and/or /usr/lib/python3.7/site-packages/beaker, /usr/lib/python3.7/site-packages/Beaker-1.10.0-py3.7.egg-info

libxml2-2.9.8 (for its Python2 module)

Introduction to the libxml2 Python2 module

These instructions provide the Python2 bindings for libxml2: the Python3 bindings are built as part of libxml2-2.9.8 and most packages in the book do not use these bindings for the older Python2.

By building these bindings after libxml2-2.9.8 has been installed, there is no need to rebuild the time-consuming (if all dependencies are used) main part of that package.

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

Package Information

libxml2 (Python2) Dependencies

Required

libxml2-2.9.8 and Python-2.7.15

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

Installation of libxml2 Python2 module

To build the Python 2 module, run:

cd python             &&
python setup.py build

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

python setup.py install --optimize=1

Contents

Installed Programs: drv_libxml2.py, libxml2.py
Installed Libraries: libxml2mod.so
Installed Directories: None

Short Descriptions

drv_libxml2.py

is a SAX Python2 driver for libxml2.

libxml2.py

is the Python2 binding for libxml2.

libxml2mod.so

is the interface for Python2 to use libxml2.so.

lxml-4.2.4

Introduction to lxml

lxml provides Python bindings for libxslt-1.1.32 and libxml2-2.9.8.

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

Package Information

lxml Dependencies

Required

libxslt-1.1.32

Optional (to run more tests)

GDB-8.1.1 Valgrind-3.13.0 cssselect

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

Installation of lxml

[Note]

Note

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

To build the Python 2 module, run:

python setup.py build

If you wish to run the tests, enter: make test. This will rebuild the package for inplace use before running the tests. One or more tests sometimes fail.

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

python setup.py install --optimize=1

To build the Python 3 module, run:

python3 setup.py clean &&
python3 setup.py build

If you wish to run the tests, enter: make PYTHON=python3 test. This will rebuild the package for inplace use before running the tests. One or more tests sometimes fail.

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

python3 setup.py install --optimize=1

Contents

Installed Programs: None
Installed Libraries: None
Installed Directories: /usr/lib/python2.7/site-packages/lxml, /usr/lib/python2.7/site-packages/lxml-4.2.4-py2.7-linux-$ARCH.egg-info and/or /usr/lib/python3.7/site-packages/lxml, /usr/lib/python3.7/site-packages/lxml-4.2.4-py3.7-linux-$ARCH.egg-info

MarkupSafe-1.0

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-8.3 platform.

Package Information

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-1.0-py2.7.egg-info and/or /usr/lib/python3.7/site-packages/markupsafe, /usr/lib/python3.7/site-packages/MarkupSafe-1.0-py3.7.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-8.3 platform.

Package Information

Mako Dependencies

Required

Beaker-1.10.0 and MarkupSafe-1.0

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.7/site-packages/mako, /usr/lib/python3.7/site-packages/Mako-1.0.4-py3.7.egg-info

Scour-0.37

Introduction to Scour

Scour is an SVG (Scalable Vector Graphics) optimizer/cleaner that reduces their size by optimizing structure and removing unnecessary data.

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

Package Information

Scour Dependencies

Optional (for the main test)

six-1.11.0

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

Installation of scour

[Note]

Note

Although this package installs modules for Python 2 or Python 3 they are usually invoked by scour which is a script using the version of Python for which it was compiled.

For the moment, use of Python 2 will normally be adequate.

To build the Python 2 module, issue:

python setup.py build

To partially test the results, issue: python testcss.py. If you have installed Six you can run the main tests by issuing: python testscour.py.

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

python setup.py install --optimize=1
[Note]

Note

If you wish to install the Python 3 modules, change 'python' to 'python3' in each of the above steps.

Contents

Installed Programs: scour
Installed Libraries: None
Installed Directories: None

Short Descriptions

scour

is a program to optimize and clean SVG files.

six-1.11.0

Introduction to Six Module

Six is a Python 2 and 3 compatibility library.

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

Package Information

Six Dependencies

Optional Dependencies

Python-2.7.15

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

Installation of six

Install six for Python2 by running the following commands:

python2 setup.py build

This package does not come with a test suite.

Now, as the root user:

python2 setup.py install --optimize=1

Install six for Python3 by running the following commands:

python3 setup.py build

This package does not come with a test suite.

Now, as the root user:

python3 setup.py install --optimize=1

Contents

Installed Programs: None
Installed Module: six.py
Installed Directories: /usr/lib/python2.7/site-packages/six-1.10.0-py2.7.egg and/or /usr/lib/python3.6/site-packages/six-1.10.0-py3.6.egg

Last updated on 2017-11-22 19:21:36 -0800