[52d29f7] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[52d29f7] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[2cee003] | 7 | <!ENTITY python3-download-http
|
---|
| 8 | "http://www.python.org/ftp/python/&python3-version;/Python-&python3-version;.tar.xz">
|
---|
| 9 | <!ENTITY python3-download-ftp
|
---|
| 10 | "&gentoo-ftp-repo;/Python-&python3-version;.tar.xz">
|
---|
[b88be39] | 11 | <!ENTITY python3-md5sum "3720ce9460597e49264bbb63b48b946d">
|
---|
| 12 | <!ENTITY python3-size "8.5 MB">
|
---|
| 13 | <!ENTITY python3-buildsize "141 MB (23MB for the test suite)">
|
---|
| 14 | <!ENTITY python3-time "1 SBU (additional 2.9 SBU to run the test suite)">
|
---|
[2cee003] | 15 | <!ENTITY python3htmldoc-download-http
|
---|
| 16 | "http://docs.python.org/ftp/python/doc/&python3-version;/python-&python3-version;-docs-html.tar.bz2">
|
---|
[b88be39] | 17 | <!ENTITY python3htmldoc-md5sum "55af06e320f35920ea9fed1f143e1286">
|
---|
| 18 | <!ENTITY python3htmldoc-size "4.2 MB">
|
---|
[52d29f7] | 19 | ]>
|
---|
| 20 |
|
---|
[b88be39] | 21 | <sect1 id="python3" xreflabel="Python-&python3-version;">
|
---|
| 22 | <?dbhtml filename="python3.html" ?>
|
---|
[83f69e5d] | 23 |
|
---|
| 24 | <sect1info>
|
---|
| 25 | <othername>$LastChangedBy$</othername>
|
---|
| 26 | <date>$Date$</date>
|
---|
| 27 | </sect1info>
|
---|
| 28 |
|
---|
[b88be39] | 29 | <title>Python-&python3-version;</title>
|
---|
[83f69e5d] | 30 |
|
---|
[b88be39] | 31 | <indexterm zone="python3">
|
---|
| 32 | <primary sortas="a-Python3">Python</primary>
|
---|
[83f69e5d] | 33 | </indexterm>
|
---|
| 34 |
|
---|
| 35 | <sect2 role="package">
|
---|
| 36 | <title>Introduction to Python</title>
|
---|
| 37 |
|
---|
| 38 | <para>The <application>Python</application> package contains the
|
---|
| 39 | <application>Python</application> development environment.
|
---|
| 40 | This is useful for object-oriented programming, writing scripts,
|
---|
| 41 | prototyping large programs or developing entire applications.</para>
|
---|
| 42 |
|
---|
[48b816cb] | 43 | <!-- Python compiled against Pth, OpenSSL, and SQLite.
|
---|
| 44 | 326 tests OK, 36 tests skipped, 0 failures -->
|
---|
| 45 |
|
---|
[4c77a949] | 46 | &lfs71_checked;
|
---|
[48b816cb] | 47 |
|
---|
[83f69e5d] | 48 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 49 | <itemizedlist spacing="compact">
|
---|
| 50 | <listitem>
|
---|
[b88be39] | 51 | <para>Download (HTTP): <ulink url="&python3-download-http;"/></para>
|
---|
[83f69e5d] | 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
[b88be39] | 54 | <para>Download (FTP): <ulink url="&python3-download-ftp;"/></para>
|
---|
[83f69e5d] | 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
[b88be39] | 57 | <para>Download MD5 sum: &python3-md5sum;</para>
|
---|
[83f69e5d] | 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
[b88be39] | 60 | <para>Download size: &python3-size;</para>
|
---|
[83f69e5d] | 61 | </listitem>
|
---|
| 62 | <listitem>
|
---|
[b88be39] | 63 | <para>Estimated disk space required: &python3-buildsize;</para>
|
---|
[83f69e5d] | 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
[b88be39] | 66 | <para>Estimated build time: &python3-time;</para>
|
---|
[83f69e5d] | 67 | </listitem>
|
---|
| 68 | </itemizedlist>
|
---|
| 69 |
|
---|
| 70 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[5f2eb36] | 71 | <!--<itemizedlist spacing='compact'>
|
---|
| 72 | <listitem>
|
---|
[10e02da] | 73 | <para>Required patch: <ulink
|
---|
[2f83800] | 74 | url="&patch-root;/Python-&Python-version;-bdb_4.8-1.patch"/></para>
|
---|
[5f2eb36] | 75 | </listitem>
|
---|
| 76 | </itemizedlist>-->
|
---|
[83f69e5d] | 77 |
|
---|
[1970f00] | 78 | <itemizedlist spacing='compact'>
|
---|
[3a94882] | 79 | <title>Optional HTML Documentation</title>
|
---|
[1970f00] | 80 | <listitem>
|
---|
[2cee003] | 81 | <para>Download (HTTP):
|
---|
| 82 | <ulink url="&python3htmldoc-download-http;"/></para>
|
---|
[3a94882] | 83 | </listitem>
|
---|
| 84 | <listitem>
|
---|
[b88be39] | 85 | <para>Download MD5 sum: &python3htmldoc-md5sum;</para>
|
---|
[3a94882] | 86 | </listitem>
|
---|
| 87 | <listitem>
|
---|
[b88be39] | 88 | <para>Download size: &python3htmldoc-size;</para>
|
---|
[1970f00] | 89 | </listitem>
|
---|
| 90 | </itemizedlist>
|
---|
| 91 |
|
---|
[83f69e5d] | 92 | <bridgehead renderas="sect3">Python Dependencies</bridgehead>
|
---|
| 93 |
|
---|
| 94 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[879d269] | 95 | <para role="optional"><xref linkend="pth"/>,
|
---|
[3531524] | 96 | <xref linkend="libffi"/> or <xref linkend="gcc"/> (install JAVA so that the
|
---|
| 97 | <filename class="libraryfile">libffi</filename> library is built), and
|
---|
[879d269] | 98 | <ulink url="http://www.bluez.org/">BlueZ</ulink></para>
|
---|
[1970f00] | 99 |
|
---|
| 100 | <bridgehead renderas="sect4">Optional
|
---|
| 101 | (to create package-specific support modules)</bridgehead>
|
---|
[256ee72c] | 102 | <para role="optional"><xref linkend="openssl"/>,
|
---|
[de7f20e] | 103 | <xref linkend="tk"/>,
|
---|
| 104 | <xref linkend="db"/>, and
|
---|
[8f9c757e] | 105 | <xref linkend="sqlite"/></para>
|
---|
[83f69e5d] | 106 |
|
---|
[ce33273] | 107 | <para>Note that there is a circular dependency with the
|
---|
| 108 | <application>Tk</application> package as it requires Xorg to be installed
|
---|
| 109 | but parts of Xorg depend on <application>Python</application>.</para>
|
---|
| 110 |
|
---|
[1039de3] | 111 | <para condition="html" role="usernotes">User Notes:
|
---|
[6c42d4e] | 112 | <ulink url="&blfs-wiki;/Python"/></para>
|
---|
[1039de3] | 113 |
|
---|
[83f69e5d] | 114 | </sect2>
|
---|
| 115 |
|
---|
| 116 | <sect2 role="installation">
|
---|
| 117 | <title>Installation of Python</title>
|
---|
| 118 |
|
---|
| 119 | <para>Install <application>Python</application> by running the following
|
---|
| 120 | commands:</para>
|
---|
| 121 |
|
---|
[955b7fd2] | 122 | <screen><userinput>sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py &&
|
---|
[52d29f7] | 123 | ./configure --prefix=/usr --enable-shared &&
|
---|
[83f69e5d] | 124 | make</userinput></screen>
|
---|
| 125 |
|
---|
[1970f00] | 126 | <para>To test the results, issue: <command>make test</command>. Note that
|
---|
| 127 | if you have an existing <application>Python</application> installation
|
---|
| 128 | which includes the <application>PyXML</application> module, the tests could
|
---|
| 129 | produce a segmentation fault.</para>
|
---|
[83f69e5d] | 130 |
|
---|
| 131 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 132 |
|
---|
[7224506] | 133 | <screen role="root"><userinput>make install &&
|
---|
| 134 | chmod -v 755 /usr/lib/libpython&python3-majorver;m.so.1.0 &&
|
---|
| 135 | chmod -v 755 /usr/lib/libpython3.so </userinput></screen>
|
---|
[83f69e5d] | 136 |
|
---|
[1970f00] | 137 | <para>There is no documentation installed using the instructions above.
|
---|
[f4031b6c] | 138 | See the <filename>Doc/README.txt</filename> file in the source
|
---|
| 139 | distribution for instructions on how to create the html. Alternatively,
|
---|
| 140 | you can download preformatted documentation from <ulink
|
---|
| 141 | url="http://docs.python.org/download.html"/>.</para>
|
---|
[1970f00] | 142 |
|
---|
[8cebf004] | 143 | <para>In order to use the <command>help ('name_string')</command> feature
|
---|
| 144 | of the <command>python</command> interpreter with some statements and
|
---|
| 145 | keywords, you must download (or create) the optional HTML documentation
|
---|
| 146 | and install it. If you downloaded the HTML docs, issue the following
|
---|
| 147 | commands as the
|
---|
[1970f00] | 148 | <systemitem class="username">root</systemitem> user:</para>
|
---|
| 149 |
|
---|
[b88be39] | 150 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python3-version;/html &&
|
---|
[1970f00] | 151 | tar --strip-components=1 \
|
---|
[cff8f9e] | 152 | --no-same-owner \
|
---|
| 153 | --no-same-permissions \
|
---|
[b88be39] | 154 | -C /usr/share/doc/Python-&python3-version;/html \
|
---|
[716ca8aa] | 155 | -xvf ../python-&python3-version;-docs-html.tar.bz2</userinput></screen>
|
---|
[1970f00] | 156 |
|
---|
[879d269] | 157 | </sect2>
|
---|
| 158 |
|
---|
| 159 | <sect2 role="commands">
|
---|
| 160 | <title>Command Explanations</title>
|
---|
| 161 |
|
---|
| 162 | <para><command>sed -i "s/ndbm_libs = ..." setup.py</command>: This command
|
---|
| 163 | is used to fix a build problem with the <application>GDBM</application>
|
---|
| 164 | library.</para>
|
---|
| 165 |
|
---|
[7224506] | 166 | <para><command>chmod ...</command>: Fix permissions for libraries to be
|
---|
| 167 | consistent with other libraries.</para>
|
---|
| 168 |
|
---|
[879d269] | 169 | </sect2>
|
---|
| 170 |
|
---|
| 171 | <sect2 role="configuration">
|
---|
| 172 | <title>Configuring Python</title>
|
---|
| 173 |
|
---|
[1970f00] | 174 | <para>In order for <command>python</command> to find the installed
|
---|
| 175 | documentation, you must add the following environment variable to
|
---|
| 176 | individual user's or the system's profile:</para>
|
---|
| 177 |
|
---|
[2cee003] | 178 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/Python-&python3-version;/html</userinput></screen>
|
---|
[83f69e5d] | 179 |
|
---|
| 180 | </sect2>
|
---|
| 181 |
|
---|
| 182 | <sect2 role="content">
|
---|
| 183 | <title>Contents</title>
|
---|
| 184 |
|
---|
| 185 | <segmentedlist>
|
---|
| 186 | <segtitle>Installed Programs</segtitle>
|
---|
| 187 | <segtitle>Installed Libraries</segtitle>
|
---|
| 188 | <segtitle>Installed Directories</segtitle>
|
---|
| 189 |
|
---|
| 190 | <seglistitem>
|
---|
[7224506] | 191 | <seg>2to3,
|
---|
| 192 |
|
---|
| 193 | pydoc3 (link to pydoc-&python3-majorver;),
|
---|
| 194 | pydoc&python3-majorver;,
|
---|
| 195 |
|
---|
| 196 | python3,
|
---|
| 197 | python&python3-majorver; (hard link with python3),
|
---|
| 198 | python&python3-majorver;m (hard link with python3),
|
---|
| 199 |
|
---|
| 200 | python3-config (link to python&python3-majorver;-config),
|
---|
| 201 | python&python3-majorver; (link to python&python3-majorver;m-config),
|
---|
| 202 | python&python3-majorver;m,
|
---|
| 203 |
|
---|
[2cee003] | 204 | smtpd.py, and optionally if <application>Tk</application> is installed,
|
---|
| 205 | idle</seg>
|
---|
[7224506] | 206 |
|
---|
[2cee003] | 207 | <seg>libpython3.so, libpython&python3-majorver;m.so.1.0 and numerous
|
---|
| 208 | modules installed in /usr/lib/python&python3-majorver;</seg>
|
---|
[7224506] | 209 |
|
---|
[b88be39] | 210 | <seg>/usr/include/python&python3-majorver;,
|
---|
[7224506] | 211 | /usr/lib/python&python3-majorver;, and
|
---|
| 212 | /usr/share/doc/python-&python3-version;</seg>
|
---|
[83f69e5d] | 213 | </seglistitem>
|
---|
| 214 | </segmentedlist>
|
---|
| 215 |
|
---|
| 216 | <variablelist>
|
---|
| 217 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 218 | <?dbfo list-presentation="list"?>
|
---|
| 219 | <?dbhtml list-presentation="table"?>
|
---|
| 220 |
|
---|
| 221 | <varlistentry id="idle">
|
---|
| 222 | <term><command>idle</command></term>
|
---|
| 223 | <listitem>
|
---|
[7cd76d62] | 224 | <para>is a wrapper script that opens a
|
---|
[83f69e5d] | 225 | <application>Python</application> aware GUI editor.</para>
|
---|
[b88be39] | 226 | <indexterm zone="python3 idle">
|
---|
[83f69e5d] | 227 | <primary sortas="b-idle">idle</primary>
|
---|
| 228 | </indexterm>
|
---|
| 229 | </listitem>
|
---|
| 230 | </varlistentry>
|
---|
| 231 |
|
---|
| 232 | <varlistentry id="pydoc">
|
---|
| 233 | <term><command>pydoc</command></term>
|
---|
| 234 | <listitem>
|
---|
[7cd76d62] | 235 | <para>is the <application>Python</application> documentation
|
---|
[83f69e5d] | 236 | tool.</para>
|
---|
[b88be39] | 237 | <indexterm zone="python3 pydoc">
|
---|
[83f69e5d] | 238 | <primary sortas="b-pydoc">pydoc</primary>
|
---|
| 239 | </indexterm>
|
---|
| 240 | </listitem>
|
---|
| 241 | </varlistentry>
|
---|
| 242 |
|
---|
[b88be39] | 243 | <varlistentry id="python3-prog">
|
---|
[2cee003] | 244 | <term><command>python3</command></term>
|
---|
[83f69e5d] | 245 | <listitem>
|
---|
[7cd76d62] | 246 | <para>is an interpreted, interactive, object-oriented programming
|
---|
[83f69e5d] | 247 | language.</para>
|
---|
[b88be39] | 248 | <indexterm zone="python3 python3-prog">
|
---|
| 249 | <primary sortas="b-python3">python3</primary>
|
---|
[83f69e5d] | 250 | </indexterm>
|
---|
| 251 | </listitem>
|
---|
| 252 | </varlistentry>
|
---|
| 253 |
|
---|
[f67f5387] | 254 | <varlistentry id="python-ver">
|
---|
[b88be39] | 255 | <term><command>python&python3-majorver;</command></term>
|
---|
[83f69e5d] | 256 | <listitem>
|
---|
[0619e6d] | 257 | <para>is a version-specific name for the <command>python</command>
|
---|
[83f69e5d] | 258 | program.</para>
|
---|
[b88be39] | 259 | <indexterm zone="python3 python-ver">
|
---|
[2cee003] | 260 | <primary
|
---|
| 261 | sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
|
---|
[83f69e5d] | 262 | </indexterm>
|
---|
| 263 | </listitem>
|
---|
| 264 | </varlistentry>
|
---|
| 265 |
|
---|
| 266 | <varlistentry id="smtpd.py">
|
---|
| 267 | <term><command>smtpd.py</command></term>
|
---|
| 268 | <listitem>
|
---|
[7cd76d62] | 269 | <para>is an SMTP proxy implemented in
|
---|
[83f69e5d] | 270 | <application>Python</application>.</para>
|
---|
[b88be39] | 271 | <indexterm zone="python3 smtpd.py">
|
---|
[83f69e5d] | 272 | <primary sortas="b-smtpd.py">smtpd.py</primary>
|
---|
| 273 | </indexterm>
|
---|
| 274 | </listitem>
|
---|
| 275 | </varlistentry>
|
---|
| 276 |
|
---|
| 277 | </variablelist>
|
---|
| 278 |
|
---|
| 279 | </sect2>
|
---|
[f45b1953] | 280 |
|
---|
| 281 | </sect1>
|
---|