[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 " ">
|
---|
[62f9a8e] | 10 | <!ENTITY python2-md5sum "62c4c1699170078c469f79ddfed21bc0">
|
---|
| 11 | <!ENTITY python2-size "9.6 MB">
|
---|
[bf847d6d] | 12 | <!ENTITY python2-buildsize "235 MB (not including the test suite)">
|
---|
[62f9a8e] | 13 | <!ENTITY python2-time "1.1 SBU (not including the test suite)">
|
---|
[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">
|
---|
[62f9a8e] | 17 | <!ENTITY python2htmldoc-md5sum "101c13d39f76fd6706aac3a9196b2f01">
|
---|
| 18 | <!ENTITY python2htmldoc-size "4.2 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 |
|
---|
[ba291e0] | 46 | &lfs72_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 |
|
---|
[82fac2c] | 103 | <bridgehead renderas="sect3">Additional Patches</bridgehead>
|
---|
| 104 | <itemizedlist spacing="compact">
|
---|
| 105 | <listitem>
|
---|
| 106 | <para>
|
---|
| 107 | Required patch:
|
---|
| 108 | <ulink url="&patch-root;/Python-&python2-version;-bsddb_fix-1.patch"/>
|
---|
| 109 | </para>
|
---|
| 110 | </listitem>
|
---|
| 111 | </itemizedlist>
|
---|
| 112 |
|
---|
[bf847d6d] | 113 | <bridgehead renderas="sect3">Python Dependencies</bridgehead>
|
---|
| 114 |
|
---|
[82fac2c] | 115 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 116 | <para role="recommended">
|
---|
[9ef15dba] | 117 | <xref linkend="expat"/>,
|
---|
| 118 | <xref linkend="libffi"/> and
|
---|
| 119 | <xref linkend="pkgconfig"/>
|
---|
[82fac2c] | 120 | </para>
|
---|
| 121 |
|
---|
[bf847d6d] | 122 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[181662f] | 123 | <para role="optional">
|
---|
[82fac2c] | 124 | <xref linkend="bluez"/> and
|
---|
| 125 | <ulink url="http://sphinx.pocoo.org/">Sphinx</ulink>
|
---|
| 126 | </para>
|
---|
| 127 |
|
---|
| 128 | <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
|
---|
| 129 | <para role="optional">
|
---|
| 130 | <xref linkend="db"/>,
|
---|
[181662f] | 131 | <xref linkend="openssl"/>,
|
---|
[82fac2c] | 132 | <xref linkend="sqlite"/> and
|
---|
| 133 | <xref linkend="tk"/>
|
---|
[181662f] | 134 | </para>
|
---|
| 135 |
|
---|
| 136 | <para condition="html" role="usernotes">
|
---|
| 137 | User Notes: <ulink url="&blfs-wiki;/Python"/>
|
---|
| 138 | </para>
|
---|
[bf847d6d] | 139 | </sect2>
|
---|
| 140 |
|
---|
| 141 | <sect2 role="installation">
|
---|
| 142 | <title>Installation of Python</title>
|
---|
| 143 |
|
---|
[181662f] | 144 | <para>
|
---|
| 145 | Install <application>Python</application> by running the following
|
---|
| 146 | commands:
|
---|
| 147 | </para>
|
---|
[bf847d6d] | 148 |
|
---|
[a66801a] | 149 | <screen><userinput>sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py &&
|
---|
[82fac2c] | 150 | patch -Np1 -i ../Python-&python2-version;-bsddb_fix-1.patch &&
|
---|
| 151 | ./configure --prefix=/usr \
|
---|
| 152 | --enable-shared \
|
---|
| 153 | --with-system-expat \
|
---|
| 154 | --with-system-ffi \
|
---|
| 155 | --enable-unicode=ucs4 &&
|
---|
[bf847d6d] | 156 | make</userinput></screen>
|
---|
| 157 |
|
---|
[181662f] | 158 | <para>
|
---|
| 159 | To test the results, issue: <command>make test</command>.
|
---|
| 160 | </para>
|
---|
[bf847d6d] | 161 |
|
---|
[181662f] | 162 | <para>
|
---|
| 163 | In order to use the <command>help ('name_string')</command> feature of the
|
---|
| 164 | <command>python</command> interpreter with some statements and keywords,
|
---|
| 165 | you must create or download the optional HTML documentation.
|
---|
| 166 | </para>
|
---|
| 167 |
|
---|
| 168 | <para>
|
---|
| 169 | If you have installed <ulink url="http://sphinx.pocoo.org/">Sphinx</ulink>
|
---|
| 170 | and wish to create the HTML documentation:
|
---|
| 171 | </para>
|
---|
| 172 |
|
---|
| 173 | <screen><userinput>make -C Doc html</userinput></screen>
|
---|
| 174 |
|
---|
| 175 | <para>
|
---|
| 176 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 177 | </para>
|
---|
[bf847d6d] | 178 |
|
---|
[7224506] | 179 | <screen role="root"><userinput>make install &&
|
---|
| 180 | chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
|
---|
[bf847d6d] | 181 |
|
---|
[181662f] | 182 | <para>
|
---|
| 183 | If you created the html documentation with
|
---|
| 184 | <application>Sphinx</application> then install it as the
|
---|
| 185 | <systemitem class="username">root</systemitem> user:
|
---|
| 186 | </para>
|
---|
[bf847d6d] | 187 |
|
---|
[181662f] | 188 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python2-version; &&
|
---|
| 189 | cp -rfv Doc/build/html/* /usr/share/doc/python-&python2-version;</userinput></screen>
|
---|
| 190 |
|
---|
| 191 | <para>
|
---|
| 192 | Alternatively, you can download preformatted documentation from
|
---|
| 193 | <ulink url="http://docs.python.org/download.html"/> and install it as the
|
---|
| 194 | <systemitem class="username">root</systemitem> user:
|
---|
| 195 | </para>
|
---|
| 196 |
|
---|
| 197 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python2-version; &&
|
---|
| 198 | tar --strip-components=1 -C /usr/share/doc/Python-&python2-version; \
|
---|
[f695fc0] | 199 | -xvf ../python-&python2-version;-docs-html.tar.bz2 &&
|
---|
| 200 | find /usr/share/doc/Python-&python2-version; -type d -exec chmod 0755 {} \; &&
|
---|
| 201 | find /usr/share/doc/Python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
|
---|
[bf847d6d] | 202 | </sect2>
|
---|
| 203 |
|
---|
| 204 | <sect2 role="commands">
|
---|
| 205 | <title>Command Explanations</title>
|
---|
| 206 |
|
---|
[a66801a] | 207 | <para>
|
---|
| 208 | <command>sed -i "s/ndbm_libs = ..." setup.py</command>: This command is
|
---|
| 209 | used to fix a build problem with the <application>GDBM</application>
|
---|
| 210 | library.
|
---|
| 211 | </para>
|
---|
| 212 |
|
---|
[82fac2c] | 213 | <para>
|
---|
| 214 | <option>--with-system-expat</option>: This switch enables linking against
|
---|
| 215 | system version of <application>Expat</application>. Remove if you have
|
---|
| 216 | not installed recommended dependency <xref linkend="expat"/>.
|
---|
| 217 | </para>
|
---|
| 218 |
|
---|
| 219 | <para>
|
---|
| 220 | <option>--with-system-ffi</option>: This switch enables linking against
|
---|
| 221 | system version of <application>libffi</application>. Remove if you have
|
---|
| 222 | not installed recommended dependency <xref linkend="libffi"/>.
|
---|
| 223 | </para>
|
---|
| 224 |
|
---|
| 225 | <para>
|
---|
| 226 | <parameter>--enable-unicode=ucs4</parameter>: This switch enables
|
---|
| 227 | 32bit Unicode support in <application>Python</application>.
|
---|
| 228 | </para>
|
---|
| 229 |
|
---|
| 230 | <para>
|
---|
| 231 | <parameter>--with-dbmliborder=bdb:gdbm:ndbm</parameter>: Use this switch
|
---|
[0d7900a] | 232 | if you want to build <application>Python</application> DBM Module
|
---|
[82fac2c] | 233 | against <application>Berkeley DB</application> instead of
|
---|
| 234 | <application>GDBM</application>.
|
---|
| 235 | </para>
|
---|
| 236 |
|
---|
[181662f] | 237 | <para>
|
---|
[0d7900a] | 238 | <command>chmod ...</command>: Fix permissions for libraries to be
|
---|
[181662f] | 239 | consistent with other libraries.
|
---|
| 240 | </para>
|
---|
[82fac2c] | 241 |
|
---|
[bf847d6d] | 242 | </sect2>
|
---|
| 243 |
|
---|
| 244 | <sect2 role="configuration">
|
---|
| 245 | <title>Configuring Python 2</title>
|
---|
| 246 |
|
---|
[181662f] | 247 | <para>
|
---|
| 248 | In order for <command>python</command> to find the installed
|
---|
| 249 | documentation, you must add the following environment variable to
|
---|
| 250 | individual user's or the system's profile:
|
---|
| 251 | </para>
|
---|
[bf847d6d] | 252 |
|
---|
[181662f] | 253 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/Python-&python2-version;</userinput></screen>
|
---|
[82fac2c] | 254 |
|
---|
[bf847d6d] | 255 | </sect2>
|
---|
| 256 |
|
---|
| 257 | <sect2 role="content">
|
---|
| 258 | <title>Contents</title>
|
---|
| 259 |
|
---|
| 260 | <segmentedlist>
|
---|
| 261 | <segtitle>Installed Programs</segtitle>
|
---|
| 262 | <segtitle>Installed Libraries</segtitle>
|
---|
| 263 | <segtitle>Installed Directories</segtitle>
|
---|
| 264 |
|
---|
| 265 | <seglistitem>
|
---|
[181662f] | 266 | <seg>
|
---|
[62f9a8e] | 267 | 2to3, pydoc, python, python-config, python&python2-majorver;,
|
---|
[181662f] | 268 | python&python2-majorver;-config, smtpd.py, and optionally if
|
---|
| 269 | <application>Tk</application> is installed, idle
|
---|
| 270 | </seg>
|
---|
| 271 | <seg>
|
---|
| 272 | libpython&python2-majorver;.so and numerous modules installed in
|
---|
| 273 | /usr/lib/python&python2-majorver;/lib-dynload
|
---|
| 274 | </seg>
|
---|
| 275 | <seg>
|
---|
| 276 | /usr/include/python&python2-majorver;,
|
---|
| 277 | /usr/lib/python&python2-majorver;, and
|
---|
| 278 | /usr/share/doc/python-&python2-version;</seg>
|
---|
[bf847d6d] | 279 | </seglistitem>
|
---|
| 280 | </segmentedlist>
|
---|
| 281 |
|
---|
| 282 | <variablelist>
|
---|
| 283 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 284 | <?dbfo list-presentation="list"?>
|
---|
| 285 | <?dbhtml list-presentation="table"?>
|
---|
| 286 |
|
---|
[62f9a8e] | 287 | <varlistentry id="python2-2to3">
|
---|
| 288 | <term><command>2to3</command></term>
|
---|
| 289 | <listitem>
|
---|
| 290 | <para>
|
---|
| 291 | is a <application>Python</application> program that reads
|
---|
| 292 | <application>Python 2.x</application> source code and applies a series of
|
---|
| 293 | fixers to transform it into valid <application>Python 3.x</application>
|
---|
| 294 | code.
|
---|
| 295 | </para>
|
---|
| 296 | <indexterm zone="python2 python2-2to3">
|
---|
| 297 | <primary sortas="b-2to3">2to3</primary>
|
---|
| 298 | </indexterm>
|
---|
| 299 | </listitem>
|
---|
| 300 | </varlistentry>
|
---|
| 301 |
|
---|
[bf847d6d] | 302 | <varlistentry id="idle2">
|
---|
| 303 | <term><command>idle</command></term>
|
---|
| 304 | <listitem>
|
---|
[181662f] | 305 | <para>
|
---|
| 306 | is a wrapper script that opens a <application>Python</application>
|
---|
| 307 | aware GUI editor.
|
---|
| 308 | </para>
|
---|
[4716d52] | 309 | <indexterm zone="python2 idle2">
|
---|
[bf847d6d] | 310 | <primary sortas="b-idle2">idle</primary>
|
---|
| 311 | </indexterm>
|
---|
| 312 | </listitem>
|
---|
| 313 | </varlistentry>
|
---|
| 314 |
|
---|
| 315 | <varlistentry id="pydoc2">
|
---|
| 316 | <term><command>pydoc</command></term>
|
---|
| 317 | <listitem>
|
---|
[181662f] | 318 | <para>
|
---|
| 319 | is the <application>Python</application> documentation tool.
|
---|
| 320 | </para>
|
---|
[4716d52] | 321 | <indexterm zone="python2 pydoc2">
|
---|
[bf847d6d] | 322 | <primary sortas="b-pydoc2">pydoc</primary>
|
---|
| 323 | </indexterm>
|
---|
| 324 | </listitem>
|
---|
| 325 | </varlistentry>
|
---|
| 326 |
|
---|
[181662f] | 327 | <varlistentry id="python">
|
---|
[bf847d6d] | 328 | <term><command>python</command></term>
|
---|
| 329 | <listitem>
|
---|
[181662f] | 330 | <para>
|
---|
| 331 | is an interpreted, interactive, object-oriented programming
|
---|
| 332 | language.
|
---|
| 333 | </para>
|
---|
| 334 | <indexterm zone="python2 python">
|
---|
[4716d52] | 335 | <primary sortas="b-python2">python</primary>
|
---|
[bf847d6d] | 336 | </indexterm>
|
---|
| 337 | </listitem>
|
---|
| 338 | </varlistentry>
|
---|
| 339 |
|
---|
| 340 | <varlistentry id="python2-ver">
|
---|
| 341 | <term><command>python&python2-majorver;</command></term>
|
---|
| 342 | <listitem>
|
---|
[181662f] | 343 | <para>
|
---|
| 344 | is a version-specific name for the <command>python</command>
|
---|
| 345 | program.
|
---|
| 346 | </para>
|
---|
[4716d52] | 347 | <indexterm zone="python2 python2-ver">
|
---|
[b88be39] | 348 | <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
|
---|
[bf847d6d] | 349 | </indexterm>
|
---|
| 350 | </listitem>
|
---|
| 351 | </varlistentry>
|
---|
| 352 |
|
---|
| 353 | <varlistentry id="smtpd.py2">
|
---|
| 354 | <term><command>smtpd.py</command></term>
|
---|
| 355 | <listitem>
|
---|
[181662f] | 356 | <para>
|
---|
| 357 | is an SMTP proxy implemented in <application>Python</application>.
|
---|
| 358 | </para>
|
---|
[4716d52] | 359 | <indexterm zone="python2 smtpd.py2">
|
---|
[bf847d6d] | 360 | <primary sortas="b-smtpd.py2">smtpd.py</primary>
|
---|
| 361 | </indexterm>
|
---|
| 362 | </listitem>
|
---|
| 363 | </varlistentry>
|
---|
[82fac2c] | 364 |
|
---|
[bf847d6d] | 365 | </variablelist>
|
---|
[82fac2c] | 366 |
|
---|
[bf847d6d] | 367 | </sect2>
|
---|
[82fac2c] | 368 |
|
---|
[bf847d6d] | 369 | </sect1>
|
---|