[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 " ">
|
---|
[549e65f] | 10 | <!ENTITY python2-md5sum "38d530f7efc373d64a8fb1637e3baaa7">
|
---|
| 11 | <!ENTITY python2-size "12 MB">
|
---|
| 12 | <!ENTITY python2-buildsize "228 MB (additional 18 MB for the tests)">
|
---|
| 13 | <!ENTITY python2-time "1.0 SBU (additional 4.6 SBU for tests)">
|
---|
[82fac2c] | 14 |
|
---|
[181662f] | 15 | <!ENTITY python2htmldoc-download-http
|
---|
[549e65f] | 16 | "https://docs.python.org/ftp/python/doc/&python2-version;/python-&python2-version;-docs-html.tar.bz2">
|
---|
| 17 | <!ENTITY python2htmldoc-md5sum "8804bc888f6b7a1cc217be1acbb59ad6">
|
---|
[d80de44] | 18 | <!ENTITY python2htmldoc-size "4.4 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 |
|
---|
[a3be7192] | 46 | &lfs76_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 | <listitem>
|
---|
[181662f] | 86 | <para>
|
---|
[167a240] | 87 | Required patch if you wish to run the test suite:
|
---|
| 88 | <ulink url="&patch-root;/Python-&python2-version;-skip_test_gdb-1.patch"/>
|
---|
[181662f] | 89 | </para>
|
---|
[bf847d6d] | 90 | </listitem>
|
---|
[5d11f8f] | 91 | </itemizedlist>
|
---|
| 92 |
|
---|
| 93 | <itemizedlist spacing="compact">
|
---|
| 94 | <title>Optional HTML Documentation</title>
|
---|
[bf847d6d] | 95 | <listitem>
|
---|
[181662f] | 96 | <para>
|
---|
[5d11f8f] | 97 | Download (HTTP): <ulink url="&python2htmldoc-download-http;"/>
|
---|
[181662f] | 98 | </para>
|
---|
[bf847d6d] | 99 | </listitem>
|
---|
| 100 | <listitem>
|
---|
[181662f] | 101 | <para>
|
---|
[5d11f8f] | 102 | Download MD5 sum: &python2htmldoc-md5sum;
|
---|
[181662f] | 103 | </para>
|
---|
[bf847d6d] | 104 | </listitem>
|
---|
[fb990982] | 105 | <listitem>
|
---|
| 106 | <para>
|
---|
[5d11f8f] | 107 | Download size: &python2htmldoc-size;
|
---|
[fb990982] | 108 | </para>
|
---|
| 109 | </listitem>
|
---|
| 110 | </itemizedlist>
|
---|
| 111 |
|
---|
[03d30cf] | 112 | <bridgehead renderas="sect3">Python 2 Dependencies</bridgehead>
|
---|
[bf847d6d] | 113 |
|
---|
[82fac2c] | 114 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 115 | <para role="recommended">
|
---|
[adf6dd9a] | 116 | <xref linkend="libffi"/>
|
---|
[82fac2c] | 117 | </para>
|
---|
| 118 |
|
---|
[bf847d6d] | 119 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[181662f] | 120 | <para role="optional">
|
---|
[549e65f] | 121 | <xref linkend="bluez"/> and
|
---|
| 122 | <xref linkend="valgrind"/>
|
---|
[82fac2c] | 123 | </para>
|
---|
| 124 |
|
---|
| 125 | <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
|
---|
| 126 | <para role="optional">
|
---|
| 127 | <xref linkend="db"/>,
|
---|
[181662f] | 128 | <xref linkend="openssl"/>,
|
---|
[82fac2c] | 129 | <xref linkend="sqlite"/> and
|
---|
| 130 | <xref linkend="tk"/>
|
---|
[181662f] | 131 | </para>
|
---|
| 132 |
|
---|
[5be3a74] | 133 | <note>
|
---|
| 134 | <para>
|
---|
| 135 | <!-- new for ff31. Any reasonable version of openssl will do,
|
---|
| 136 | even old maintained versions, so do not xref openssl here -->
|
---|
[b9f61df] | 137 | If you are building <xref linkend="thunderbird"/> or
|
---|
| 138 | <xref linkend="firefox"/>
|
---|
[80454f5] | 139 | you must install <application>openssl</application> before you build
|
---|
[5be3a74] | 140 | <application>Python 2</application>.
|
---|
| 141 | </para>
|
---|
| 142 | </note>
|
---|
| 143 |
|
---|
[181662f] | 144 | <para condition="html" role="usernotes">
|
---|
| 145 | User Notes: <ulink url="&blfs-wiki;/Python"/>
|
---|
| 146 | </para>
|
---|
[bf847d6d] | 147 | </sect2>
|
---|
| 148 |
|
---|
| 149 | <sect2 role="installation">
|
---|
[03d30cf] | 150 | <title>Installation of Python 2</title>
|
---|
[bf847d6d] | 151 |
|
---|
[181662f] | 152 | <para>
|
---|
[03d30cf] | 153 | Install <application>Python 2</application> by running the following
|
---|
[181662f] | 154 | commands:
|
---|
| 155 | </para>
|
---|
[bf847d6d] | 156 |
|
---|
[167a240] | 157 | <screen><userinput>./configure --prefix=/usr \
|
---|
[82fac2c] | 158 | --enable-shared \
|
---|
| 159 | --with-system-expat \
|
---|
| 160 | --with-system-ffi \
|
---|
| 161 | --enable-unicode=ucs4 &&
|
---|
[bf847d6d] | 162 | make</userinput></screen>
|
---|
| 163 |
|
---|
[167a240] | 164 | <para>
|
---|
| 165 | If you wish to run the test suite, disable a test that fails:
|
---|
| 166 | </para>
|
---|
| 167 |
|
---|
| 168 | <screen><userinput>patch -Np1 -i ../Python-&python2-version;-skip_test_gdb-1.patch</userinput></screen>
|
---|
| 169 |
|
---|
[181662f] | 170 | <para>
|
---|
| 171 | To test the results, issue: <command>make test</command>.
|
---|
| 172 | </para>
|
---|
[bf847d6d] | 173 |
|
---|
[181662f] | 174 | <para>
|
---|
| 175 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 176 | </para>
|
---|
[bf847d6d] | 177 |
|
---|
[7224506] | 178 | <screen role="root"><userinput>make install &&
|
---|
| 179 | chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
|
---|
[bf847d6d] | 180 |
|
---|
[181662f] | 181 | <para>
|
---|
[7fe0ce3b] | 182 | Since <application>Python 2</application> is in maintenance mode, and
|
---|
| 183 | <application>Python 3</application> is recommended by upstream for
|
---|
[8b9b43e] | 184 | development, you probably do not need to install the documentation.
|
---|
[7fe0ce3b] | 185 | However, if you still want to install documentation for both
|
---|
[8b9b43e] | 186 | <application>Python</application> versions, be sure to define the
|
---|
| 187 | <envar>PYTHONDOCS</envar>
|
---|
[7fe0ce3b] | 188 | variable for the version you want to use, each time you need to consult
|
---|
| 189 | the documentation. If you have downloaded the preformatted documentation
|
---|
| 190 | from <ulink url="http://docs.python.org/download.html"/>, install it
|
---|
[03d30cf] | 191 | as the <systemitem class="username">root</systemitem> user:
|
---|
[181662f] | 192 | </para>
|
---|
| 193 |
|
---|
[23d3543c] | 194 | <screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python2-version; &&
|
---|
[03d30cf] | 195 | tar --strip-components=1 -C /usr/share/doc/python-&python2-version; \
|
---|
[ff3093a7] | 196 | --no-same-owner -xvf ../python-&python2-version;-docs-html.tar.bz2 &&
|
---|
[03d30cf] | 197 | find /usr/share/doc/python-&python2-version; -type d -exec chmod 0755 {} \; &&
|
---|
| 198 | find /usr/share/doc/python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
|
---|
[bf847d6d] | 199 | </sect2>
|
---|
| 200 |
|
---|
| 201 | <sect2 role="commands">
|
---|
| 202 | <title>Command Explanations</title>
|
---|
| 203 |
|
---|
[82fac2c] | 204 | <para>
|
---|
| 205 | <option>--with-system-expat</option>: This switch enables linking against
|
---|
[56605b9] | 206 | system version of <application>Expat</application>.
|
---|
[82fac2c] | 207 | </para>
|
---|
| 208 |
|
---|
| 209 | <para>
|
---|
| 210 | <option>--with-system-ffi</option>: This switch enables linking against
|
---|
| 211 | system version of <application>libffi</application>. Remove if you have
|
---|
[03d30cf] | 212 | not installed <xref linkend="libffi"/>.
|
---|
[82fac2c] | 213 | </para>
|
---|
| 214 |
|
---|
| 215 | <para>
|
---|
| 216 | <parameter>--enable-unicode=ucs4</parameter>: This switch enables
|
---|
| 217 | 32bit Unicode support in <application>Python</application>.
|
---|
| 218 | </para>
|
---|
| 219 |
|
---|
| 220 | <para>
|
---|
| 221 | <parameter>--with-dbmliborder=bdb:gdbm:ndbm</parameter>: Use this switch
|
---|
[0d7900a] | 222 | if you want to build <application>Python</application> DBM Module
|
---|
[82fac2c] | 223 | against <application>Berkeley DB</application> instead of
|
---|
| 224 | <application>GDBM</application>.
|
---|
| 225 | </para>
|
---|
| 226 |
|
---|
[181662f] | 227 | <para>
|
---|
[0d7900a] | 228 | <command>chmod ...</command>: Fix permissions for libraries to be
|
---|
[181662f] | 229 | consistent with other libraries.
|
---|
| 230 | </para>
|
---|
[82fac2c] | 231 |
|
---|
[bf847d6d] | 232 | </sect2>
|
---|
| 233 |
|
---|
| 234 | <sect2 role="configuration">
|
---|
| 235 | <title>Configuring Python 2</title>
|
---|
| 236 |
|
---|
[181662f] | 237 | <para>
|
---|
| 238 | In order for <command>python</command> to find the installed
|
---|
| 239 | documentation, you must add the following environment variable to
|
---|
| 240 | individual user's or the system's profile:
|
---|
| 241 | </para>
|
---|
[bf847d6d] | 242 |
|
---|
[03d30cf] | 243 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-&python2-version;</userinput></screen>
|
---|
[82fac2c] | 244 |
|
---|
[bf847d6d] | 245 | </sect2>
|
---|
| 246 |
|
---|
| 247 | <sect2 role="content">
|
---|
| 248 | <title>Contents</title>
|
---|
| 249 |
|
---|
| 250 | <segmentedlist>
|
---|
| 251 | <segtitle>Installed Programs</segtitle>
|
---|
[03d30cf] | 252 | <segtitle>Installed Library</segtitle>
|
---|
[bf847d6d] | 253 | <segtitle>Installed Directories</segtitle>
|
---|
| 254 |
|
---|
| 255 | <seglistitem>
|
---|
[181662f] | 256 | <seg>
|
---|
[167a240] | 257 | 2to3, pydoc, python (symlink), python-config (symlink),
|
---|
| 258 | python2 (symlink), python2-config (symlink),
|
---|
[03d30cf] | 259 | python&python2-majorver;, python&python2-majorver;-config,
|
---|
[d0aecd33] | 260 | smtpd.py, and idle
|
---|
[181662f] | 261 | </seg>
|
---|
| 262 | <seg>
|
---|
[03d30cf] | 263 | libpython&python2-majorver;.so
|
---|
[0c3e9be8] | 264 | and several under /usr/lib/python&python2-majorver;/{config,lib-dynload}
|
---|
[181662f] | 265 | </seg>
|
---|
| 266 | <seg>
|
---|
| 267 | /usr/include/python&python2-majorver;,
|
---|
| 268 | /usr/lib/python&python2-majorver;, and
|
---|
| 269 | /usr/share/doc/python-&python2-version;</seg>
|
---|
[bf847d6d] | 270 | </seglistitem>
|
---|
| 271 | </segmentedlist>
|
---|
| 272 |
|
---|
| 273 | <variablelist>
|
---|
| 274 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 275 | <?dbfo list-presentation="list"?>
|
---|
| 276 | <?dbhtml list-presentation="table"?>
|
---|
| 277 |
|
---|
[62f9a8e] | 278 | <varlistentry id="python2-2to3">
|
---|
| 279 | <term><command>2to3</command></term>
|
---|
| 280 | <listitem>
|
---|
| 281 | <para>
|
---|
| 282 | is a <application>Python</application> program that reads
|
---|
| 283 | <application>Python 2.x</application> source code and applies a series of
|
---|
| 284 | fixers to transform it into valid <application>Python 3.x</application>
|
---|
| 285 | code.
|
---|
| 286 | </para>
|
---|
| 287 | <indexterm zone="python2 python2-2to3">
|
---|
| 288 | <primary sortas="b-2to3">2to3</primary>
|
---|
| 289 | </indexterm>
|
---|
| 290 | </listitem>
|
---|
| 291 | </varlistentry>
|
---|
| 292 |
|
---|
[03d30cf] | 293 | <varlistentry id="idle">
|
---|
[bf847d6d] | 294 | <term><command>idle</command></term>
|
---|
| 295 | <listitem>
|
---|
[181662f] | 296 | <para>
|
---|
| 297 | is a wrapper script that opens a <application>Python</application>
|
---|
[d0aecd33] | 298 | aware GUI editor. For this script to run, you must have installed
|
---|
| 299 | <application>Tk</application> before Python so that the Tkinter
|
---|
| 300 | Python module is built.
|
---|
[181662f] | 301 | </para>
|
---|
[03d30cf] | 302 | <indexterm zone="python2 idle">
|
---|
| 303 | <primary sortas="b-idle">idle</primary>
|
---|
[bf847d6d] | 304 | </indexterm>
|
---|
| 305 | </listitem>
|
---|
| 306 | </varlistentry>
|
---|
| 307 |
|
---|
| 308 | <varlistentry id="pydoc2">
|
---|
| 309 | <term><command>pydoc</command></term>
|
---|
| 310 | <listitem>
|
---|
[181662f] | 311 | <para>
|
---|
| 312 | is the <application>Python</application> documentation tool.
|
---|
| 313 | </para>
|
---|
[4716d52] | 314 | <indexterm zone="python2 pydoc2">
|
---|
[bf847d6d] | 315 | <primary sortas="b-pydoc2">pydoc</primary>
|
---|
| 316 | </indexterm>
|
---|
| 317 | </listitem>
|
---|
| 318 | </varlistentry>
|
---|
| 319 |
|
---|
[181662f] | 320 | <varlistentry id="python">
|
---|
[bf847d6d] | 321 | <term><command>python</command></term>
|
---|
| 322 | <listitem>
|
---|
[181662f] | 323 | <para>
|
---|
| 324 | is an interpreted, interactive, object-oriented programming
|
---|
| 325 | language.
|
---|
| 326 | </para>
|
---|
| 327 | <indexterm zone="python2 python">
|
---|
[4716d52] | 328 | <primary sortas="b-python2">python</primary>
|
---|
[bf847d6d] | 329 | </indexterm>
|
---|
| 330 | </listitem>
|
---|
| 331 | </varlistentry>
|
---|
| 332 |
|
---|
| 333 | <varlistentry id="python2-ver">
|
---|
| 334 | <term><command>python&python2-majorver;</command></term>
|
---|
| 335 | <listitem>
|
---|
[181662f] | 336 | <para>
|
---|
| 337 | is a version-specific name for the <command>python</command>
|
---|
| 338 | program.
|
---|
| 339 | </para>
|
---|
[4716d52] | 340 | <indexterm zone="python2 python2-ver">
|
---|
[b88be39] | 341 | <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
|
---|
[bf847d6d] | 342 | </indexterm>
|
---|
| 343 | </listitem>
|
---|
| 344 | </varlistentry>
|
---|
| 345 |
|
---|
[03d30cf] | 346 | <varlistentry id="smtpd.py">
|
---|
[bf847d6d] | 347 | <term><command>smtpd.py</command></term>
|
---|
| 348 | <listitem>
|
---|
[181662f] | 349 | <para>
|
---|
| 350 | is an SMTP proxy implemented in <application>Python</application>.
|
---|
| 351 | </para>
|
---|
[03d30cf] | 352 | <indexterm zone="python2 smtpd.py">
|
---|
| 353 | <primary sortas="b-smtpd.py">smtpd.py</primary>
|
---|
[bf847d6d] | 354 | </indexterm>
|
---|
| 355 | </listitem>
|
---|
| 356 | </varlistentry>
|
---|
[82fac2c] | 357 |
|
---|
[bf847d6d] | 358 | </variablelist>
|
---|
[82fac2c] | 359 |
|
---|
[bf847d6d] | 360 | </sect2>
|
---|
[82fac2c] | 361 |
|
---|
[bf847d6d] | 362 | </sect1>
|
---|