[b0aabe0] | 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 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-system-Python" role="wrap">
|
---|
| 9 | <?dbhtml filename="Python.html"?>
|
---|
| 10 |
|
---|
| 11 | <sect1info condition="script">
|
---|
| 12 | <productname>Python</productname>
|
---|
| 13 | <productnumber>&python-version;</productnumber>
|
---|
| 14 | <address>&python-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
| 17 | <title>Python-&python-version;</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-system-Python">
|
---|
| 20 | <primary sortas="a-python">python</primary>
|
---|
| 21 | </indexterm>
|
---|
| 22 |
|
---|
| 23 | <sect2 role="package">
|
---|
| 24 | <title/>
|
---|
| 25 |
|
---|
| 26 | <para>The Python 3 package contains the Python development environment. It
|
---|
| 27 | is useful for object-oriented programming, writing scripts, prototyping
|
---|
| 28 | large programs or developing entire applications.</para>
|
---|
| 29 |
|
---|
| 30 | <segmentedlist>
|
---|
| 31 | <segtitle>&buildtime;</segtitle>
|
---|
| 32 | <segtitle>&diskspace;</segtitle>
|
---|
| 33 |
|
---|
| 34 | <seglistitem>
|
---|
| 35 | <seg>&python-ch6-sbu;</seg>
|
---|
| 36 | <seg>&python-ch6-du;</seg>
|
---|
| 37 | </seglistitem>
|
---|
| 38 | </segmentedlist>
|
---|
| 39 |
|
---|
| 40 | </sect2>
|
---|
| 41 |
|
---|
| 42 | <sect2 role="installation">
|
---|
| 43 | <title>Installation of Python 3</title>
|
---|
| 44 |
|
---|
| 45 | <para>Prepare Python for compilation:</para>
|
---|
| 46 |
|
---|
| 47 | <screen><userinput remap="configure">./configure --prefix=/usr \
|
---|
| 48 | --enable-shared \
|
---|
| 49 | --with-system-expat \
|
---|
| 50 | --with-system-ffi \
|
---|
[f682fb5f] | 51 | --with-ensurepip=yes</userinput></screen>
|
---|
[b0aabe0] | 52 |
|
---|
| 53 | <variablelist>
|
---|
| 54 | <title>The meaning of the configure options:</title>
|
---|
| 55 |
|
---|
| 56 | <varlistentry>
|
---|
| 57 | <term><parameter>--with-system-expat</parameter></term>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>This switch enables linking against system version of
|
---|
| 60 | <application>Expat</application>.</para>
|
---|
| 61 | </listitem>
|
---|
| 62 | </varlistentry>
|
---|
| 63 |
|
---|
| 64 | <varlistentry>
|
---|
| 65 | <term><parameter>--with-system-ffi</parameter></term>
|
---|
| 66 | <listitem>
|
---|
| 67 | <para>This switch enables linking against system version of
|
---|
| 68 | <application>libffi</application>.</para>
|
---|
| 69 | </listitem>
|
---|
| 70 | </varlistentry>
|
---|
| 71 |
|
---|
| 72 | <varlistentry>
|
---|
| 73 | <term><parameter>--with-ensurepip=yes</parameter></term>
|
---|
| 74 | <listitem>
|
---|
| 75 | <para>This switch enables building <command>pip</command> and
|
---|
| 76 | <command>setuptools</command> packaging programs.</para>
|
---|
| 77 | </listitem>
|
---|
| 78 | </varlistentry>
|
---|
| 79 |
|
---|
| 80 | </variablelist>
|
---|
| 81 |
|
---|
| 82 | <para>Compile the package:</para>
|
---|
| 83 |
|
---|
| 84 | <screen><userinput remap="make">make</userinput></screen>
|
---|
| 85 |
|
---|
[0aaf6a31] | 86 | <para>The test suite requires TK and X Windows session and cannot
|
---|
[b0aabe0] | 87 | be run until Python 3 is reinstalled in BLFS.</para>
|
---|
| 88 |
|
---|
| 89 | <para>Install the package:</para>
|
---|
| 90 |
|
---|
| 91 | <screen><userinput remap="install">make install
|
---|
[9c31d62] | 92 | chmod -v 755 /usr/lib/libpython&python-minor;.so
|
---|
[ab4ca91] | 93 | chmod -v 755 /usr/lib/libpython3.so
|
---|
[9c31d62] | 94 | ln -sfv pip&python-minor; /usr/bin/pip3</userinput></screen>
|
---|
[b0aabe0] | 95 |
|
---|
| 96 | <variablelist>
|
---|
| 97 | <title>The meaning of the install commands:</title>
|
---|
[9c31d62] | 98 | <!-- ====== Change 8m if Python minor version changes ======= -->
|
---|
[b0aabe0] | 99 | <varlistentry>
|
---|
[9c31d62] | 100 | <term><command>chmod -v 755 /usr/lib/libpython3.{8.,}so</command></term>
|
---|
[b0aabe0] | 101 | <listitem>
|
---|
| 102 | <para>Fix permissions for libraries to be consistent with other
|
---|
| 103 | libraries.</para>
|
---|
| 104 | </listitem>
|
---|
| 105 | </varlistentry>
|
---|
| 106 |
|
---|
| 107 | </variablelist>
|
---|
| 108 |
|
---|
| 109 | <para>If desired, install the preformatted documentation:</para>
|
---|
| 110 |
|
---|
| 111 | <screen><userinput remap="install">install -v -dm755 /usr/share/doc/python-&python-version;/html
|
---|
| 112 |
|
---|
| 113 | tar --strip-components=1 \
|
---|
| 114 | --no-same-owner \
|
---|
| 115 | --no-same-permissions \
|
---|
| 116 | -C /usr/share/doc/python-&python-version;/html \
|
---|
| 117 | -xvf ../python-&python-version;-docs-html.tar.bz2</userinput></screen>
|
---|
| 118 |
|
---|
| 119 | <variablelist>
|
---|
| 120 | <title>The meaning of the documentation install commands:</title>
|
---|
| 121 |
|
---|
| 122 | <varlistentry>
|
---|
[ae39e19] | 123 | <term><option>--no-same-owner</option> and <option>--no-same-permissions</option></term>
|
---|
[b0aabe0] | 124 | <listitem>
|
---|
| 125 | <para>Ensure the installed files have the correct ownership and
|
---|
[aa8c64b] | 126 | permissions. Without these options, using <application>tar</application>
|
---|
[b0aabe0] | 127 | will install the package files with the upstream creator's values.
|
---|
| 128 | </para>
|
---|
| 129 | </listitem>
|
---|
| 130 | </varlistentry>
|
---|
| 131 |
|
---|
| 132 | </variablelist>
|
---|
| 133 |
|
---|
| 134 | </sect2>
|
---|
| 135 |
|
---|
| 136 | <sect2 id="contents-python" role="content">
|
---|
| 137 | <title>Contents of Python 3</title>
|
---|
| 138 |
|
---|
| 139 | <segmentedlist>
|
---|
| 140 | <segtitle>Installed Programs</segtitle>
|
---|
| 141 | <segtitle>Installed Library</segtitle>
|
---|
| 142 | <segtitle>Installed Directories</segtitle>
|
---|
| 143 |
|
---|
| 144 | <seglistitem>
|
---|
| 145 | <seg>
|
---|
[78cc3be] | 146 | 2to3, idle3, pip3, pydoc3, python3, python3-config, and pyvenv
|
---|
[b0aabe0] | 147 | </seg>
|
---|
| 148 | <seg>
|
---|
[9c31d62] | 149 | libpython&python-minor;.so and libpython3.so
|
---|
[b0aabe0] | 150 | </seg>
|
---|
| 151 | <seg>
|
---|
[9c31d62] | 152 | /usr/include/python&python-minor;,
|
---|
| 153 | /usr/lib/python3, and
|
---|
[b0aabe0] | 154 | /usr/share/doc/python-&python-version;
|
---|
| 155 | </seg>
|
---|
| 156 | </seglistitem>
|
---|
| 157 | </segmentedlist>
|
---|
| 158 |
|
---|
| 159 | <variablelist>
|
---|
| 160 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 161 | <?dbfo list-presentation="list"?>
|
---|
| 162 | <?dbhtml list-presentation="table"?>
|
---|
| 163 |
|
---|
| 164 | <varlistentry id="python-2to3">
|
---|
| 165 | <term><command>2to3</command></term>
|
---|
| 166 | <listitem>
|
---|
| 167 | <para>
|
---|
| 168 | is a <application>Python</application> program that reads
|
---|
| 169 | <application>Python 2.x</application> source code and applies a
|
---|
| 170 | series of fixes to transform it into valid
|
---|
| 171 | <application>Python 3.x</application> code.
|
---|
| 172 | </para>
|
---|
| 173 | <indexterm zone="ch-system-Python">
|
---|
| 174 | <primary sortas="b-2to3">2to3</primary>
|
---|
| 175 | </indexterm>
|
---|
| 176 | </listitem>
|
---|
| 177 | </varlistentry>
|
---|
| 178 |
|
---|
| 179 | <varlistentry id="idle3">
|
---|
| 180 | <term><command>idle3</command></term>
|
---|
| 181 | <listitem>
|
---|
| 182 | <para>
|
---|
| 183 | is a wrapper script that opens a <application>Python</application>
|
---|
| 184 | aware GUI editor. For this script to run, you must have installed
|
---|
| 185 | <application>Tk</application> before Python so that the Tkinter
|
---|
| 186 | Python module is built.
|
---|
| 187 | </para>
|
---|
| 188 | <indexterm zone="ch-system-Python">
|
---|
| 189 | <primary sortas="b-idle3">idle3</primary>
|
---|
| 190 | </indexterm>
|
---|
| 191 | </listitem>
|
---|
| 192 | </varlistentry>
|
---|
| 193 |
|
---|
[78cc3be] | 194 | <varlistentry id="pip3">
|
---|
| 195 | <term><command>pip3</command></term>
|
---|
| 196 | <listitem>
|
---|
| 197 | <para>
|
---|
| 198 | The package installer for Python. You can use pip to install
|
---|
[93058448] | 199 | packages from Python Package Index and other indexes.
|
---|
[78cc3be] | 200 | </para>
|
---|
| 201 | <indexterm zone="ch-system-Python">
|
---|
| 202 | <primary sortas="b-pip3">pip3</primary>
|
---|
| 203 | </indexterm>
|
---|
| 204 | </listitem>
|
---|
| 205 | </varlistentry>
|
---|
| 206 |
|
---|
[b0aabe0] | 207 | <varlistentry id="pydoc3">
|
---|
| 208 | <term><command>pydoc3</command></term>
|
---|
| 209 | <listitem>
|
---|
| 210 | <para>
|
---|
| 211 | is the <application>Python</application> documentation tool.
|
---|
| 212 | </para>
|
---|
| 213 | <indexterm zone="ch-system-Python">
|
---|
| 214 | <primary sortas="b-pydoc3">pydoc3</primary>
|
---|
| 215 | </indexterm>
|
---|
| 216 | </listitem>
|
---|
| 217 | </varlistentry>
|
---|
| 218 |
|
---|
| 219 | <varlistentry id="python3">
|
---|
| 220 | <term><command>python3</command></term>
|
---|
| 221 | <listitem>
|
---|
| 222 | <para>
|
---|
| 223 | is an interpreted, interactive, object-oriented programming
|
---|
| 224 | language.
|
---|
| 225 | </para>
|
---|
| 226 | <indexterm zone="ch-system-Python">
|
---|
| 227 | <primary sortas="b-python3">python3</primary>
|
---|
| 228 | </indexterm>
|
---|
| 229 | </listitem>
|
---|
| 230 | </varlistentry>
|
---|
| 231 |
|
---|
| 232 | <varlistentry id="pyvenv">
|
---|
| 233 | <term><command>pyvenv</command></term>
|
---|
| 234 | <listitem>
|
---|
| 235 | <para>
|
---|
| 236 | creates virtual <application>Python</application> environments in
|
---|
| 237 | one or more target directories.
|
---|
| 238 | </para>
|
---|
| 239 | <indexterm zone="ch-system-Python">
|
---|
| 240 | <primary sortas="b-pyvenv">pyvenv</primary>
|
---|
| 241 | </indexterm>
|
---|
| 242 | </listitem>
|
---|
| 243 | </varlistentry>
|
---|
| 244 |
|
---|
| 245 | </variablelist>
|
---|
| 246 |
|
---|
| 247 | </sect2>
|
---|
| 248 |
|
---|
| 249 | </sect1>
|
---|
| 250 |
|
---|