Python-3.2.2

Introduction to Python

The Python package contains the Python development environment. This is useful for object-oriented programming, writing scripts, prototyping large programs or developing entire applications.

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

Package Information

Additional Downloads

Optional HTML Documentation

Python Dependencies

Optional

Pth-2.0.7, libffi-3.0.10 or GCC-4.5.1 (install JAVA so that the libffi library is built), and BlueZ

Optional (to create package-specific support modules)

OpenSSL-1.0.0e, Tk-8.5.9, Berkeley DB-5.2.36, and SQLite-3.7.8

Note that there is a circular dependency with the Tk package as it requires Xorg to be installed but parts of Xorg depend on Python.

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

Installation of Python

Install Python by running the following commands:

sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py &&
./configure --prefix=/usr --enable-shared &&
make

To test the results, issue: make test. Note that if you have an existing Python installation which includes the PyXML module, the tests could produce a segmentation fault.

Now, as the root user:

make install                               &&
chmod -v 755 /usr/lib/libpython3.2m.so.1.0 &&
chmod -v 755 /usr/lib/libpython3.so 

There is no documentation installed using the instructions above. See the Doc/README.txt file in the source distribution for instructions on how to create the html. Alternatively, you can download preformatted documentation from http://docs.python.org/download.html.

In order to use the help ('name_string') feature of the python interpreter with some statements and keywords, you must download (or create) the optional HTML documentation and install it. If you downloaded the HTML docs, issue the following commands as the root user:

install -v -m755 -d /usr/share/doc/Python-3.2.2/html &&
tar --strip-components=1 \
    --no-same-owner \
    --no-same-permissions \
    -C /usr/share/doc/Python-3.2.2/html \
    -xvf ../python-3.2.2-docs-html.tar.bz2

Command Explanations

sed -i "s/ndbm_libs = ..." setup.py: This command is used to fix a build problem with the GDBM library.

chmod ...: Fix permissions for libraries to be consistent with other libraries.

Configuring Python

In order for python to find the installed documentation, you must add the following environment variable to individual user's or the system's profile:

export PYTHONDOCS=/usr/share/doc/Python-3.2.2/html

Contents

Installed Programs: 2to3, pydoc3 (link to pydoc-3.2), pydoc3.2, python3, python3.2 (hard link with python3), python3.2m (hard link with python3), python3-config (link to python3.2-config), python3.2 (link to python3.2m-config), python3.2m, smtpd.py, and optionally if Tk is installed, idle
Installed Libraries: libpython3.so, libpython3.2m.so.1.0 and numerous modules installed in /usr/lib/python3.2
Installed Directories: /usr/include/python3.2, /usr/lib/python3.2, and /usr/share/doc/python-3.2.2

Short Descriptions

idle

is a wrapper script that opens a Python aware GUI editor.

pydoc

is the Python documentation tool.

python

is an interpreted, interactive, object-oriented programming language.

python3.2

is a version-specific name for the python program.

smtpd.py

is an SMTP proxy implemented in Python.

Last updated on 2012-01-08 17:42:27 +0000