2011-10-31 02:47:49 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<!ENTITY python2-download-http
|
|
|
|
"http://www.python.org/ftp/python/&python2-version;/Python-&python2-version;.tar.xz">
|
2011-11-11 00:39:50 +08:00
|
|
|
<!ENTITY python2-download-ftp " ">
|
|
|
|
<!-- <!ENTITY python2-download-ftp "&gentoo-ftp-repo;/Python-&python2-version;.tar.xz"> -->
|
2012-04-11 09:07:46 +08:00
|
|
|
<!ENTITY python2-md5sum "62c4c1699170078c469f79ddfed21bc0">
|
|
|
|
<!ENTITY python2-size "9.6 MB">
|
2011-10-31 02:47:49 +08:00
|
|
|
<!ENTITY python2-buildsize "235 MB (not including the test suite)">
|
2012-04-11 09:07:46 +08:00
|
|
|
<!ENTITY python2-time "1.1 SBU (not including the test suite)">
|
2012-03-05 04:29:13 +08:00
|
|
|
<!ENTITY python2htmldoc-download-http
|
|
|
|
"http://docs.python.org/ftp/python/doc/&python2-version;/python-&python2-version;-docs-html.tar.bz2">
|
2012-04-11 09:07:46 +08:00
|
|
|
<!ENTITY python2htmldoc-md5sum "101c13d39f76fd6706aac3a9196b2f01">
|
|
|
|
<!ENTITY python2htmldoc-size "4.2 MB">
|
2011-10-31 02:47:49 +08:00
|
|
|
]>
|
|
|
|
|
2012-02-17 22:43:28 +08:00
|
|
|
<sect1 id="python2" xreflabel="Python-&python2-version;">
|
2011-10-31 02:47:49 +08:00
|
|
|
<?dbhtml filename="python2.html" ?>
|
|
|
|
|
|
|
|
<sect1info>
|
2012-01-24 11:05:41 +08:00
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
2011-10-31 02:47:49 +08:00
|
|
|
</sect1info>
|
|
|
|
|
|
|
|
<title>Python-&python2-version;</title>
|
|
|
|
|
2012-02-17 22:43:28 +08:00
|
|
|
<indexterm zone="python2">
|
2011-10-31 02:47:49 +08:00
|
|
|
<primary sortas="a-Python2">Python</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<sect2 role="package">
|
|
|
|
<title>Introduction to Python 2</title>
|
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
The <application>Python 2</application> package contains the
|
|
|
|
<application>Python</application> development environment. This is useful
|
|
|
|
for object-oriented programming, writing scripts, prototyping large
|
|
|
|
programs or developing entire applications. This version is for backward
|
|
|
|
compatibility with other dependent packages.
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
|
2012-08-24 19:37:54 +08:00
|
|
|
&lfs72_checked;
|
2011-10-31 02:47:49 +08:00
|
|
|
|
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
|
|
<itemizedlist spacing="compact">
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Download (HTTP): <ulink url="&python2-download-http;"/>
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Download (FTP): <ulink url="&python2-download-ftp;"/>
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Download MD5 sum: &python2-md5sum;
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Download size: &python2-size;
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Estimated disk space required: &python2-buildsize;
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Estimated build time: &python2-time;
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
|
|
|
|
2012-02-17 22:43:28 +08:00
|
|
|
<itemizedlist spacing="compact">
|
2011-10-31 02:47:49 +08:00
|
|
|
<title>Optional HTML Documentation</title>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Download (HTTP): <ulink url="&python2htmldoc-download-http;"/>
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Download MD5 sum: &python2htmldoc-md5sum;
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Download size: &python2htmldoc-size;
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<bridgehead renderas="sect3">Python Dependencies</bridgehead>
|
|
|
|
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para role="optional">
|
|
|
|
<!-- <xref linkend="pth"/> can only be used if you've overwritten glibc's
|
|
|
|
libpthread. -->
|
|
|
|
<xref linkend="libffi"/> and <xref linkend="pkgconfig"/>
|
|
|
|
(<command>configure</command> uses <command>pkgconfig</command> to find
|
|
|
|
<application>libffi</application>. There is a circular dependency here:
|
|
|
|
<application>Pkgconfig</application> requires
|
|
|
|
<application>Glib</application> which requires
|
|
|
|
<application>Python 2</application>),
|
|
|
|
<!-- gcc's libffi does not install a pkgconfig file -->
|
|
|
|
<ulink url="http://sphinx.pocoo.org/">Sphinx</ulink> (to create the docs),
|
2012-07-07 21:58:58 +08:00
|
|
|
<xref linkend="bluez"/>,
|
2012-03-05 04:29:13 +08:00
|
|
|
<xref linkend="openssl"/>,
|
|
|
|
<xref linkend="tk"/> (there is a circular dependency with the
|
|
|
|
<application>Tk</application> package as it requires Xorg to be installed
|
|
|
|
but parts of Xorg depend on <application>Python</application>),
|
2012-04-11 09:07:46 +08:00
|
|
|
<!--<xref linkend="db"/> and-->
|
|
|
|
<ulink
|
|
|
|
url="http://www.oracle.com/technetwork/products/berkeleydb/downloads/">BerkeleyDB</ulink>
|
|
|
|
(only versions up to 4.8), and
|
2012-03-05 04:29:13 +08:00
|
|
|
<xref linkend="sqlite"/>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para condition="html" role="usernotes">
|
|
|
|
User Notes: <ulink url="&blfs-wiki;/Python"/>
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="installation">
|
|
|
|
<title>Installation of Python</title>
|
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
Install <application>Python</application> by running the following
|
|
|
|
commands:
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
|
2012-03-06 22:04:03 +08:00
|
|
|
<screen><userinput>sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py &&
|
|
|
|
./configure --prefix=/usr --enable-shared &&
|
2011-10-31 02:47:49 +08:00
|
|
|
make</userinput></screen>
|
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
To test the results, issue: <command>make test</command>.
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
In order to use the <command>help ('name_string')</command> feature of the
|
|
|
|
<command>python</command> interpreter with some statements and keywords,
|
|
|
|
you must create or download the optional HTML documentation.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If you have installed <ulink url="http://sphinx.pocoo.org/">Sphinx</ulink>
|
|
|
|
and wish to create the HTML documentation:
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<screen><userinput>make -C Doc html</userinput></screen>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Now, as the <systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
|
2011-11-02 01:39:25 +08:00
|
|
|
<screen role="root"><userinput>make install &&
|
|
|
|
chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
|
2011-10-31 02:47:49 +08:00
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
If you created the html documentation with
|
|
|
|
<application>Sphinx</application> then install it as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python2-version; &&
|
|
|
|
cp -rfv Doc/build/html/* /usr/share/doc/python-&python2-version;</userinput></screen>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Alternatively, you can download preformatted documentation from
|
|
|
|
<ulink url="http://docs.python.org/download.html"/> and install it as the
|
|
|
|
<systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python2-version; &&
|
|
|
|
tar --strip-components=1 -C /usr/share/doc/Python-&python2-version; \
|
|
|
|
-xvf ../python-&python2-version;-docs-html.tar.bz2</userinput></screen>
|
2011-10-31 02:47:49 +08:00
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="commands">
|
|
|
|
<title>Command Explanations</title>
|
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
<option>--with-system-ffi</option>: If you have installed
|
|
|
|
<application>Libffi</application> and
|
|
|
|
<application>Pkgconfig</application>, add this option to compile
|
|
|
|
<application>Python</application>'s _ctypes module using the system
|
|
|
|
installed <application>Libffi</application>. Otherwise
|
|
|
|
<application>Python</application> will compile its own copy of
|
|
|
|
<application>Libffi</application>.
|
|
|
|
</para>
|
|
|
|
|
2012-03-06 22:04:03 +08:00
|
|
|
<para>
|
|
|
|
<command>sed -i "s/ndbm_libs = ..." setup.py</command>: This command is
|
|
|
|
used to fix a build problem with the <application>GDBM</application>
|
|
|
|
library.
|
|
|
|
</para>
|
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
<command>chmod ...</command>: Fix permissions for libraries to be
|
|
|
|
consistent with other libraries.
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="configuration">
|
|
|
|
<title>Configuring Python 2</title>
|
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
In order for <command>python</command> to find the installed
|
|
|
|
documentation, you must add the following environment variable to
|
|
|
|
individual user's or the system's profile:
|
|
|
|
</para>
|
2011-10-31 02:47:49 +08:00
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/Python-&python2-version;</userinput></screen>
|
2011-10-31 02:47:49 +08:00
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="content">
|
|
|
|
<title>Contents</title>
|
|
|
|
|
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>Installed Programs</segtitle>
|
|
|
|
<segtitle>Installed Libraries</segtitle>
|
|
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
|
|
|
|
<seglistitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<seg>
|
2012-04-11 09:07:46 +08:00
|
|
|
2to3, pydoc, python, python-config, python&python2-majorver;,
|
2012-03-05 04:29:13 +08:00
|
|
|
python&python2-majorver;-config, smtpd.py, and optionally if
|
|
|
|
<application>Tk</application> is installed, idle
|
|
|
|
</seg>
|
|
|
|
<seg>
|
|
|
|
libpython&python2-majorver;.so and numerous modules installed in
|
|
|
|
/usr/lib/python&python2-majorver;/lib-dynload
|
|
|
|
</seg>
|
|
|
|
<seg>
|
|
|
|
/usr/include/python&python2-majorver;,
|
|
|
|
/usr/lib/python&python2-majorver;, and
|
|
|
|
/usr/share/doc/python-&python2-version;</seg>
|
2011-10-31 02:47:49 +08:00
|
|
|
</seglistitem>
|
|
|
|
</segmentedlist>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
|
|
<?dbfo list-presentation="list"?>
|
|
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
|
2012-04-11 09:07:46 +08:00
|
|
|
<varlistentry id="python2-2to3">
|
|
|
|
<term><command>2to3</command></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
is a <application>Python</application> program that reads
|
|
|
|
<application>Python 2.x</application> source code and applies a series of
|
|
|
|
fixers to transform it into valid <application>Python 3.x</application>
|
|
|
|
code.
|
|
|
|
</para>
|
|
|
|
<indexterm zone="python2 python2-2to3">
|
|
|
|
<primary sortas="b-2to3">2to3</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2011-10-31 02:47:49 +08:00
|
|
|
<varlistentry id="idle2">
|
|
|
|
<term><command>idle</command></term>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
is a wrapper script that opens a <application>Python</application>
|
|
|
|
aware GUI editor.
|
|
|
|
</para>
|
2012-02-17 22:43:28 +08:00
|
|
|
<indexterm zone="python2 idle2">
|
2011-10-31 02:47:49 +08:00
|
|
|
<primary sortas="b-idle2">idle</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="pydoc2">
|
|
|
|
<term><command>pydoc</command></term>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
is the <application>Python</application> documentation tool.
|
|
|
|
</para>
|
2012-02-17 22:43:28 +08:00
|
|
|
<indexterm zone="python2 pydoc2">
|
2011-10-31 02:47:49 +08:00
|
|
|
<primary sortas="b-pydoc2">pydoc</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2012-03-05 04:29:13 +08:00
|
|
|
<varlistentry id="python">
|
2011-10-31 02:47:49 +08:00
|
|
|
<term><command>python</command></term>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
is an interpreted, interactive, object-oriented programming
|
|
|
|
language.
|
|
|
|
</para>
|
|
|
|
<indexterm zone="python2 python">
|
2012-02-17 22:43:28 +08:00
|
|
|
<primary sortas="b-python2">python</primary>
|
2011-10-31 02:47:49 +08:00
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="python2-ver">
|
|
|
|
<term><command>python&python2-majorver;</command></term>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
is a version-specific name for the <command>python</command>
|
|
|
|
program.
|
|
|
|
</para>
|
2012-02-17 22:43:28 +08:00
|
|
|
<indexterm zone="python2 python2-ver">
|
2011-11-01 03:38:44 +08:00
|
|
|
<primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
|
2011-10-31 02:47:49 +08:00
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="smtpd.py2">
|
|
|
|
<term><command>smtpd.py</command></term>
|
|
|
|
<listitem>
|
2012-03-05 04:29:13 +08:00
|
|
|
<para>
|
|
|
|
is an SMTP proxy implemented in <application>Python</application>.
|
|
|
|
</para>
|
2012-02-17 22:43:28 +08:00
|
|
|
<indexterm zone="python2 smtpd.py2">
|
2011-10-31 02:47:49 +08:00
|
|
|
<primary sortas="b-smtpd.py2">smtpd.py</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|