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.

PyXML-0.8.4

Introduction to PyXML Module

The PyXML package contains a validating XML parser, an implementation of the SAX and DOM programming interfaces, an interface to the Expat parser, and a C helper module that can speed up xmllib.py by a factor of five. This is useful for validating, parsing and manipulating XML files using Python programs.

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

Package Information

PyXML Dependencies

Required

Python-2.7.3

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

Installation of PyXML

Install PyXML by running the following commands:

python setup.py build

Now, as the root user:

python setup.py install &&
install -v -m644 doc/man/xmlproc_*.1 /usr/share/man/man1 &&
install -v -m755 -d /usr/share/doc/PyXML-0.8.4 &&
cp -v -R doc demo test /usr/share/doc/PyXML-0.8.4 &&
install -v -m644 README* /usr/share/doc/PyXML-0.8.4

To run the regression tests, the package must first be installed. Then, as an unprivileged user, issue the following commands:

cd test &&
python regrtest.py &&
cd ..

Command Explanations

python setup.py build: This command copies the *.py files to a staging area and compiles the C extensions.

python setup.py install: This command installs the package.

Contents

Installed Programs: xmlproc_parse and xmlproc_val
Installed Libraries: PyXML Python library modules
Installed Directories: /usr/lib/python2.7/site-packages/_xmlplus and /usr/share/doc/PyXML-0.8.4

Short Descriptions

xmlproc_parse

is a simple XML file parser using the xmlproc parser.

xmlproc_val

is a validating XML file parser using the xmlproc parser.

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

Package Information

Py2cairo Dependencies

Required

Python-2.7.3 and cairo-1.12.2

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 requires the optional pytest package. If installed, it is run by changing to the test directory and running py.test.

Now, as the root user:

./waf install

Contents

Installed Libraries: _cairo.so
Installed Directory: /usr/include/pycairo and /usr/lib/python2.7/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.1 platform.

Package Information

Additional Downloads

PyGObject Dependencies

Required

Py2cairo-1.10.0 and pkg-config-0.26.

Optional

gobject-introspection-1.32.1 and libxslt-1.1.26 (to Build Documentation)

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

Installation of PyGObject

Install PyGObject by running the following commands:

patch -p1 < ../pygobject-2.28.6-introspection-1.patch &&
./configure --prefix=/usr &&
make

This package does not have a working testsuite.

Now, as the root user:

make install

Command Explanations

--disable-introspection: This switch is required if you have not installed gobject-introspection.

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

Introduction to PyGObject Module

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

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

Package Information

PyGObject Dependencies

Required

Py2cairo-1.10.0 and gobject-introspection-1.32.1

Optional

libxslt-1.1.26 (to Build Documentation)

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

Installation of PyGObject

Install PyGObject by running the following commands:

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

To test the results, issue: make check.

Now, as the root user:

make install

Command Explanations

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

Contents

Installed Program: pygobject-codegen-2.0
Installed Library: libpyglib-gi-2.0-python.so
Installed Directory: /usr/include/pygobject-3.0

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

Package Information

PyGTK Dependencies

Required

PyGObject-2.28.6

Required (atk module)

atk-2.4.0

Required (pango module)

Pango-1.30.0

Required (pangocairo module)

Py2cairo-1.10.0 and Pango-1.30.0

Required (gtk and gtk.unixprint modules)

Py2cairo-1.10.0 and gtk+-2.24.10.

Required (gtk.libglade module)

Py2cairo-1.10.0 and libglade-2.6.4.

Optional

NumPy

Optional (to Build Documentation)

libxslt-1.1.26

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.26 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.

PyGtkSourceView-2.10.1

Introduction to PyGtkSourceView Module

PyGtkSourceView contains python bindings for the version 2 of the GtkSourceView library.

Package Information

PyGtkSourceView Dependencies

Required

gtksourceview-3.4.2 and PyGTK-2.24.0.

Recommended
Optional

GTK-Doc-1.18

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

Installation of PyGtkSourceView

Install PyGtkSourceView by running the following commands:

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

This package does not come with a test suite.

Now, as the root user:

make install

Command Explanations

--disable-docs: This option disables the documentation building and is required if DocBook is not installed.

--enable-gtk-doc: Use this parameter if GTK-Doc is installed and you wish to rebuild and install the API documentation.

Contents

Installed Libraries: gtksourceview2.so
Installed Directory: /usr/share/gtk-doc/html/pygtksourceview2

Short Descriptions

gtksourceview2.so

PyGtkSourceView Python library module.

pyatspi2-2.4.0

Introduction to pyatspi2

The pyatspi2 package contains Python2 bindings for the core components of GNOME Accessibility.

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

Package Information

pyatspi2 Dependencies

Required

PyGObject-3.2.2

Recommended

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

Installation of pyatspi2

Install pyatspi2 by running the following commands:

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

To test the results, issue: make check.

Now, as the root user:

make install

Contents

Installed Directory: /usr/lib/python2.7/site-packages/pyatspi

PyXDG-0.19

Introduction to PyXDG Module

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

Package Information

PyXDG Dependencies

Required

Python-2.7.3

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

Installation of PyXDG

Install pyxdg by running the following commands as the root user:

python setup.py install

Command Explanations

python setup.py install: This command installs the package. There are other options available, see Python setup.py --help-commands for details.

Contents

Installed Programs: BaseDirectory.py, Config.py, Exceptions.py, IconTheme.py, IniFile.py, Locale.py, Menu.py and RecentFile.py.
Installed Directories: /usr/lib/python2.7/site-packages/xdg

IPython-0.12

Introduction to IPython Module

IPython provides a rich toolkit to help you make the most out of using Python interactively.

Package Information

IPython Dependencies

Required

Python-2.7.3 ( or Python-3.2.2 : not tested), and SQLite-3.7.11

optional

sphinx (for building docs), pygments (for syntax higlighting documentation), nose (to build the test program), pexpect (for standalone doctests), and sphinx (for qtconsole, notebook, parallel computing)

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

Installation of IPython

Install ipython by running the following commands as the root user:

python setup.py install --prefix=/usr

If you built this against nose, you can run the testsuite after the package has been installed by entering: iptest. The tests test_startup_{,i}py (and perhaps others if you provided the optional dependencies) will fail.

Command Explanations

python setup.py install --prefix=/usr: This command installs the package. The prefix ensures that the programs are located in /usr/bin instead of /usr/local/bin.

Contents

Installed Programs: ipcluster, ipcontroller, ipengine, iplogger, iptest (if nose was installed), ipython, irunner, pycolor and a host of python scripts.
Installed Directories: /usr/lib/python2.7/site-packages/IPython and /usr/share/doc/IPython.

Short Descriptions

ipcluster

IPython parallel computing cluster control tool

ipcontroller

IPython parallel computing controller control tool

ipengine

IPython parallel computing engine control tool

iplogger

IPython logger fpr parallel computing

iptest

runs the IPython testsuite

ipython

Tools for Interactive Computing in Python

irunner

is an interface to IPython's runner module

pycolor

Colorize a python file or stdin using ANSI and print to stdout

Last updated on 2012-05-16 16:39:28 +0000