[bf847d6d] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[181662f] | 7 | <!ENTITY python2-download-http
|
---|
[82fac2c] | 8 | "http://www.python.org/ftp/python/&python2-version;/Python-&python2-version;.tar.xz">
|
---|
[27d9434] | 9 | <!ENTITY python2-download-ftp " ">
|
---|
[ff3093a7] | 10 | <!ENTITY python2-md5sum "bcf93efa8eaf383c98ed3ce40b763497">
|
---|
| 11 | <!ENTITY python2-size "9.9 MB">
|
---|
| 12 | <!ENTITY python2-buildsize "261 MB">
|
---|
| 13 | <!ENTITY python2-time "1.0 SBU (additional 5.5 SBU for tests)">
|
---|
[82fac2c] | 14 |
|
---|
[181662f] | 15 | <!ENTITY python2htmldoc-download-http
|
---|
[82fac2c] | 16 | "http://docs.python.org/ftp/python/doc/&python2-version;/python-&python2-version;-docs-html.tar.bz2">
|
---|
[ff3093a7] | 17 | <!ENTITY python2htmldoc-md5sum "7613314d1aaa7dcc522ca9d3fd43dace">
|
---|
[03d30cf] | 18 | <!ENTITY python2htmldoc-size "4.3 MB">
|
---|
[bf847d6d] | 19 | ]>
|
---|
| 20 |
|
---|
[4716d52] | 21 | <sect1 id="python2" xreflabel="Python-&python2-version;">
|
---|
[bf847d6d] | 22 | <?dbhtml filename="python2.html" ?>
|
---|
| 23 |
|
---|
| 24 | <sect1info>
|
---|
[4949485e] | 25 | <othername>$LastChangedBy$</othername>
|
---|
| 26 | <date>$Date$</date>
|
---|
[bf847d6d] | 27 | </sect1info>
|
---|
| 28 |
|
---|
| 29 | <title>Python-&python2-version;</title>
|
---|
| 30 |
|
---|
[4716d52] | 31 | <indexterm zone="python2">
|
---|
[82fac2c] | 32 | <primary sortas="a-Python2">Python2</primary>
|
---|
[bf847d6d] | 33 | </indexterm>
|
---|
| 34 |
|
---|
| 35 | <sect2 role="package">
|
---|
| 36 | <title>Introduction to Python 2</title>
|
---|
| 37 |
|
---|
[181662f] | 38 | <para>
|
---|
| 39 | The <application>Python 2</application> package contains the
|
---|
[82fac2c] | 40 | <application>Python</application> development environment. It is useful
|
---|
[181662f] | 41 | for object-oriented programming, writing scripts, prototyping large
|
---|
| 42 | programs or developing entire applications. This version is for backward
|
---|
| 43 | compatibility with other dependent packages.
|
---|
| 44 | </para>
|
---|
[bf847d6d] | 45 |
|
---|
[a0111a9] | 46 | &lfs75_checked;
|
---|
[bf847d6d] | 47 |
|
---|
| 48 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 49 | <itemizedlist spacing="compact">
|
---|
| 50 | <listitem>
|
---|
[181662f] | 51 | <para>
|
---|
| 52 | Download (HTTP): <ulink url="&python2-download-http;"/>
|
---|
| 53 | </para>
|
---|
[bf847d6d] | 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
[181662f] | 56 | <para>
|
---|
| 57 | Download (FTP): <ulink url="&python2-download-ftp;"/>
|
---|
| 58 | </para>
|
---|
[bf847d6d] | 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
[181662f] | 61 | <para>
|
---|
| 62 | Download MD5 sum: &python2-md5sum;
|
---|
| 63 | </para>
|
---|
[bf847d6d] | 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
[181662f] | 66 | <para>
|
---|
| 67 | Download size: &python2-size;
|
---|
| 68 | </para>
|
---|
[bf847d6d] | 69 | </listitem>
|
---|
| 70 | <listitem>
|
---|
[181662f] | 71 | <para>
|
---|
| 72 | Estimated disk space required: &python2-buildsize;
|
---|
| 73 | </para>
|
---|
[bf847d6d] | 74 | </listitem>
|
---|
| 75 | <listitem>
|
---|
[181662f] | 76 | <para>
|
---|
| 77 | Estimated build time: &python2-time;
|
---|
| 78 | </para>
|
---|
[bf847d6d] | 79 | </listitem>
|
---|
| 80 | </itemizedlist>
|
---|
| 81 |
|
---|
| 82 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 83 |
|
---|
[4716d52] | 84 | <itemizedlist spacing="compact">
|
---|
[bf847d6d] | 85 | <title>Optional HTML Documentation</title>
|
---|
| 86 | <listitem>
|
---|
[181662f] | 87 | <para>
|
---|
| 88 | Download (HTTP): <ulink url="&python2htmldoc-download-http;"/>
|
---|
| 89 | </para>
|
---|
[bf847d6d] | 90 | </listitem>
|
---|
| 91 | <listitem>
|
---|
[181662f] | 92 | <para>
|
---|
| 93 | Download MD5 sum: &python2htmldoc-md5sum;
|
---|
| 94 | </para>
|
---|
[bf847d6d] | 95 | </listitem>
|
---|
| 96 | <listitem>
|
---|
[181662f] | 97 | <para>
|
---|
| 98 | Download size: &python2htmldoc-size;
|
---|
| 99 | </para>
|
---|
[bf847d6d] | 100 | </listitem>
|
---|
| 101 | </itemizedlist>
|
---|
| 102 |
|
---|
[03d30cf] | 103 | <bridgehead renderas="sect3">Python 2 Dependencies</bridgehead>
|
---|
[bf847d6d] | 104 |
|
---|
[82fac2c] | 105 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 106 | <para role="recommended">
|
---|
[adf6dd9a] | 107 | <xref linkend="expat"/> and
|
---|
| 108 | <xref linkend="libffi"/>
|
---|
[82fac2c] | 109 | </para>
|
---|
| 110 |
|
---|
[bf847d6d] | 111 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[181662f] | 112 | <para role="optional">
|
---|
[03d30cf] | 113 | <xref linkend="bluez"/>
|
---|
[82fac2c] | 114 | </para>
|
---|
| 115 |
|
---|
| 116 | <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
|
---|
| 117 | <para role="optional">
|
---|
| 118 | <xref linkend="db"/>,
|
---|
[181662f] | 119 | <xref linkend="openssl"/>,
|
---|
[82fac2c] | 120 | <xref linkend="sqlite"/> and
|
---|
| 121 | <xref linkend="tk"/>
|
---|
[181662f] | 122 | </para>
|
---|
| 123 |
|
---|
| 124 | <para condition="html" role="usernotes">
|
---|
| 125 | User Notes: <ulink url="&blfs-wiki;/Python"/>
|
---|
| 126 | </para>
|
---|
[bf847d6d] | 127 | </sect2>
|
---|
| 128 |
|
---|
| 129 | <sect2 role="installation">
|
---|
[03d30cf] | 130 | <title>Installation of Python 2</title>
|
---|
[bf847d6d] | 131 |
|
---|
[181662f] | 132 | <para>
|
---|
[03d30cf] | 133 | Install <application>Python 2</application> by running the following
|
---|
[181662f] | 134 | commands:
|
---|
| 135 | </para>
|
---|
[bf847d6d] | 136 |
|
---|
[4af4be4] | 137 | <screen><userinput>./configure --prefix=/usr \
|
---|
[82fac2c] | 138 | --enable-shared \
|
---|
| 139 | --with-system-expat \
|
---|
| 140 | --with-system-ffi \
|
---|
| 141 | --enable-unicode=ucs4 &&
|
---|
[bf847d6d] | 142 | make</userinput></screen>
|
---|
| 143 |
|
---|
[181662f] | 144 | <para>
|
---|
| 145 | To test the results, issue: <command>make test</command>.
|
---|
| 146 | </para>
|
---|
[bf847d6d] | 147 |
|
---|
[181662f] | 148 | <para>
|
---|
| 149 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 150 | </para>
|
---|
[bf847d6d] | 151 |
|
---|
[7224506] | 152 | <screen role="root"><userinput>make install &&
|
---|
| 153 | chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
|
---|
[bf847d6d] | 154 |
|
---|
[181662f] | 155 | <para>
|
---|
[7fe0ce3b] | 156 | Since <application>Python 2</application> is in maintenance mode, and
|
---|
| 157 | <application>Python 3</application> is recommended by upstream for
|
---|
| 158 | development, probably, you do not need to install the documentation.
|
---|
| 159 | However, if you still want to install documentation for both
|
---|
| 160 | <application>Python</application> versions, be sure to define PYTHONDOCS
|
---|
| 161 | variable for the version you want to use, each time you need to consult
|
---|
| 162 | the documentation. If you have downloaded the preformatted documentation
|
---|
| 163 | from <ulink url="http://docs.python.org/download.html"/>, install it
|
---|
[03d30cf] | 164 | as the <systemitem class="username">root</systemitem> user:
|
---|
[181662f] | 165 | </para>
|
---|
| 166 |
|
---|
[23d3543c] | 167 | <screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python2-version; &&
|
---|
[03d30cf] | 168 | tar --strip-components=1 -C /usr/share/doc/python-&python2-version; \
|
---|
[ff3093a7] | 169 | --no-same-owner -xvf ../python-&python2-version;-docs-html.tar.bz2 &&
|
---|
[03d30cf] | 170 | find /usr/share/doc/python-&python2-version; -type d -exec chmod 0755 {} \; &&
|
---|
| 171 | find /usr/share/doc/python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
|
---|
[bf847d6d] | 172 | </sect2>
|
---|
| 173 |
|
---|
| 174 | <sect2 role="commands">
|
---|
| 175 | <title>Command Explanations</title>
|
---|
| 176 |
|
---|
[82fac2c] | 177 | <para>
|
---|
| 178 | <option>--with-system-expat</option>: This switch enables linking against
|
---|
| 179 | system version of <application>Expat</application>. Remove if you have
|
---|
[03d30cf] | 180 | not installed <xref linkend="expat"/>.
|
---|
[82fac2c] | 181 | </para>
|
---|
| 182 |
|
---|
| 183 | <para>
|
---|
| 184 | <option>--with-system-ffi</option>: This switch enables linking against
|
---|
| 185 | system version of <application>libffi</application>. Remove if you have
|
---|
[03d30cf] | 186 | not installed <xref linkend="libffi"/>.
|
---|
[82fac2c] | 187 | </para>
|
---|
| 188 |
|
---|
| 189 | <para>
|
---|
| 190 | <parameter>--enable-unicode=ucs4</parameter>: This switch enables
|
---|
| 191 | 32bit Unicode support in <application>Python</application>.
|
---|
| 192 | </para>
|
---|
| 193 |
|
---|
| 194 | <para>
|
---|
| 195 | <parameter>--with-dbmliborder=bdb:gdbm:ndbm</parameter>: Use this switch
|
---|
[0d7900a] | 196 | if you want to build <application>Python</application> DBM Module
|
---|
[82fac2c] | 197 | against <application>Berkeley DB</application> instead of
|
---|
| 198 | <application>GDBM</application>.
|
---|
| 199 | </para>
|
---|
| 200 |
|
---|
[181662f] | 201 | <para>
|
---|
[0d7900a] | 202 | <command>chmod ...</command>: Fix permissions for libraries to be
|
---|
[181662f] | 203 | consistent with other libraries.
|
---|
| 204 | </para>
|
---|
[82fac2c] | 205 |
|
---|
[bf847d6d] | 206 | </sect2>
|
---|
| 207 |
|
---|
| 208 | <sect2 role="configuration">
|
---|
| 209 | <title>Configuring Python 2</title>
|
---|
| 210 |
|
---|
[181662f] | 211 | <para>
|
---|
| 212 | In order for <command>python</command> to find the installed
|
---|
| 213 | documentation, you must add the following environment variable to
|
---|
| 214 | individual user's or the system's profile:
|
---|
| 215 | </para>
|
---|
[bf847d6d] | 216 |
|
---|
[03d30cf] | 217 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-&python2-version;</userinput></screen>
|
---|
[82fac2c] | 218 |
|
---|
[bf847d6d] | 219 | </sect2>
|
---|
| 220 |
|
---|
| 221 | <sect2 role="content">
|
---|
| 222 | <title>Contents</title>
|
---|
| 223 |
|
---|
| 224 | <segmentedlist>
|
---|
| 225 | <segtitle>Installed Programs</segtitle>
|
---|
[03d30cf] | 226 | <segtitle>Installed Library</segtitle>
|
---|
[bf847d6d] | 227 | <segtitle>Installed Directories</segtitle>
|
---|
| 228 |
|
---|
| 229 | <seglistitem>
|
---|
[181662f] | 230 | <seg>
|
---|
[03d30cf] | 231 | 2to3, pydoc, python, python-config, python2, python2-config,
|
---|
| 232 | python&python2-majorver;, python&python2-majorver;-config,
|
---|
| 233 | smtpd.py, and optionally if <application>Tk</application>
|
---|
| 234 | is installed, idle
|
---|
[181662f] | 235 | </seg>
|
---|
| 236 | <seg>
|
---|
[03d30cf] | 237 | libpython&python2-majorver;.so
|
---|
[181662f] | 238 | </seg>
|
---|
| 239 | <seg>
|
---|
| 240 | /usr/include/python&python2-majorver;,
|
---|
| 241 | /usr/lib/python&python2-majorver;, and
|
---|
| 242 | /usr/share/doc/python-&python2-version;</seg>
|
---|
[bf847d6d] | 243 | </seglistitem>
|
---|
| 244 | </segmentedlist>
|
---|
| 245 |
|
---|
| 246 | <variablelist>
|
---|
| 247 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 248 | <?dbfo list-presentation="list"?>
|
---|
| 249 | <?dbhtml list-presentation="table"?>
|
---|
| 250 |
|
---|
[62f9a8e] | 251 | <varlistentry id="python2-2to3">
|
---|
| 252 | <term><command>2to3</command></term>
|
---|
| 253 | <listitem>
|
---|
| 254 | <para>
|
---|
| 255 | is a <application>Python</application> program that reads
|
---|
| 256 | <application>Python 2.x</application> source code and applies a series of
|
---|
| 257 | fixers to transform it into valid <application>Python 3.x</application>
|
---|
| 258 | code.
|
---|
| 259 | </para>
|
---|
| 260 | <indexterm zone="python2 python2-2to3">
|
---|
| 261 | <primary sortas="b-2to3">2to3</primary>
|
---|
| 262 | </indexterm>
|
---|
| 263 | </listitem>
|
---|
| 264 | </varlistentry>
|
---|
| 265 |
|
---|
[03d30cf] | 266 | <varlistentry id="idle">
|
---|
[bf847d6d] | 267 | <term><command>idle</command></term>
|
---|
| 268 | <listitem>
|
---|
[181662f] | 269 | <para>
|
---|
| 270 | is a wrapper script that opens a <application>Python</application>
|
---|
| 271 | aware GUI editor.
|
---|
| 272 | </para>
|
---|
[03d30cf] | 273 | <indexterm zone="python2 idle">
|
---|
| 274 | <primary sortas="b-idle">idle</primary>
|
---|
[bf847d6d] | 275 | </indexterm>
|
---|
| 276 | </listitem>
|
---|
| 277 | </varlistentry>
|
---|
| 278 |
|
---|
| 279 | <varlistentry id="pydoc2">
|
---|
| 280 | <term><command>pydoc</command></term>
|
---|
| 281 | <listitem>
|
---|
[181662f] | 282 | <para>
|
---|
| 283 | is the <application>Python</application> documentation tool.
|
---|
| 284 | </para>
|
---|
[4716d52] | 285 | <indexterm zone="python2 pydoc2">
|
---|
[bf847d6d] | 286 | <primary sortas="b-pydoc2">pydoc</primary>
|
---|
| 287 | </indexterm>
|
---|
| 288 | </listitem>
|
---|
| 289 | </varlistentry>
|
---|
| 290 |
|
---|
[181662f] | 291 | <varlistentry id="python">
|
---|
[bf847d6d] | 292 | <term><command>python</command></term>
|
---|
| 293 | <listitem>
|
---|
[181662f] | 294 | <para>
|
---|
| 295 | is an interpreted, interactive, object-oriented programming
|
---|
| 296 | language.
|
---|
| 297 | </para>
|
---|
| 298 | <indexterm zone="python2 python">
|
---|
[4716d52] | 299 | <primary sortas="b-python2">python</primary>
|
---|
[bf847d6d] | 300 | </indexterm>
|
---|
| 301 | </listitem>
|
---|
| 302 | </varlistentry>
|
---|
| 303 |
|
---|
| 304 | <varlistentry id="python2-ver">
|
---|
| 305 | <term><command>python&python2-majorver;</command></term>
|
---|
| 306 | <listitem>
|
---|
[181662f] | 307 | <para>
|
---|
| 308 | is a version-specific name for the <command>python</command>
|
---|
| 309 | program.
|
---|
| 310 | </para>
|
---|
[4716d52] | 311 | <indexterm zone="python2 python2-ver">
|
---|
[b88be39] | 312 | <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
|
---|
[bf847d6d] | 313 | </indexterm>
|
---|
| 314 | </listitem>
|
---|
| 315 | </varlistentry>
|
---|
| 316 |
|
---|
[03d30cf] | 317 | <varlistentry id="smtpd.py">
|
---|
[bf847d6d] | 318 | <term><command>smtpd.py</command></term>
|
---|
| 319 | <listitem>
|
---|
[181662f] | 320 | <para>
|
---|
| 321 | is an SMTP proxy implemented in <application>Python</application>.
|
---|
| 322 | </para>
|
---|
[03d30cf] | 323 | <indexterm zone="python2 smtpd.py">
|
---|
| 324 | <primary sortas="b-smtpd.py">smtpd.py</primary>
|
---|
[bf847d6d] | 325 | </indexterm>
|
---|
| 326 | </listitem>
|
---|
| 327 | </varlistentry>
|
---|
[82fac2c] | 328 |
|
---|
[bf847d6d] | 329 | </variablelist>
|
---|
[82fac2c] | 330 |
|
---|
[bf847d6d] | 331 | </sect2>
|
---|
[82fac2c] | 332 |
|
---|
[bf847d6d] | 333 | </sect1>
|
---|