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