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 \
|
---|
51 | --with-ensurepip=yes</userinput></screen>
|
---|
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 |
|
---|
86 | <para>The test suite requires TK and and X Windows session and cannot
|
---|
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
|
---|
92 | chmod -v 755 /usr/lib/libpython&python-minor;m.so
|
---|
93 | chmod -v 755 /usr/lib/libpython3.so</userinput></screen>
|
---|
94 |
|
---|
95 | <variablelist>
|
---|
96 | <title>The meaning of the install commands:</title>
|
---|
97 | <!-- ====== Change 7m if Python minor version changes ======= -->
|
---|
98 | <varlistentry>
|
---|
99 | <term><command>chmod -v 755 /usr/lib/libpython3.{7m.,}so</command></term>
|
---|
100 | <listitem>
|
---|
101 | <para>Fix permissions for libraries to be consistent with other
|
---|
102 | libraries.</para>
|
---|
103 | </listitem>
|
---|
104 | </varlistentry>
|
---|
105 |
|
---|
106 | </variablelist>
|
---|
107 |
|
---|
108 | <para>If desired, install the preformatted documentation:</para>
|
---|
109 |
|
---|
110 | <screen><userinput remap="install">install -v -dm755 /usr/share/doc/python-&python-version;/html
|
---|
111 |
|
---|
112 | tar --strip-components=1 \
|
---|
113 | --no-same-owner \
|
---|
114 | --no-same-permissions \
|
---|
115 | -C /usr/share/doc/python-&python-version;/html \
|
---|
116 | -xvf ../python-&python-version;-docs-html.tar.bz2</userinput></screen>
|
---|
117 |
|
---|
118 | <variablelist>
|
---|
119 | <title>The meaning of the documentation install commands:</title>
|
---|
120 |
|
---|
121 | <varlistentry>
|
---|
122 | <term><option>--no-same-owner</option> and --no-same-permissions</term>
|
---|
123 | <listitem>
|
---|
124 | <para>Ensure the installed files have the correct ownership and
|
---|
125 | permissions. Without these options, using <application>tar</application>
|
---|
126 | will install the package files with the upstream creator's values.
|
---|
127 | </para>
|
---|
128 | </listitem>
|
---|
129 | </varlistentry>
|
---|
130 |
|
---|
131 | </variablelist>
|
---|
132 |
|
---|
133 | </sect2>
|
---|
134 |
|
---|
135 | <sect2 id="contents-python" role="content">
|
---|
136 | <title>Contents of Python 3</title>
|
---|
137 |
|
---|
138 | <segmentedlist>
|
---|
139 | <segtitle>Installed Programs</segtitle>
|
---|
140 | <segtitle>Installed Library</segtitle>
|
---|
141 | <segtitle>Installed Directories</segtitle>
|
---|
142 |
|
---|
143 | <seglistitem>
|
---|
144 | <seg>
|
---|
145 | 2to3, idle3, pydoc3, python3, python3-config, pyvenv
|
---|
146 | </seg>
|
---|
147 | <seg>
|
---|
148 | libpython&python-minor;m.so and libpython3.so
|
---|
149 | </seg>
|
---|
150 | <seg>
|
---|
151 | /usr/include/python&python-minor;m, /usr/lib/python3 and
|
---|
152 | /usr/share/doc/python-&python-version;
|
---|
153 | </seg>
|
---|
154 | </seglistitem>
|
---|
155 | </segmentedlist>
|
---|
156 |
|
---|
157 | <variablelist>
|
---|
158 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
159 | <?dbfo list-presentation="list"?>
|
---|
160 | <?dbhtml list-presentation="table"?>
|
---|
161 |
|
---|
162 | <varlistentry id="python-2to3">
|
---|
163 | <term><command>2to3</command></term>
|
---|
164 | <listitem>
|
---|
165 | <para>
|
---|
166 | is a <application>Python</application> program that reads
|
---|
167 | <application>Python 2.x</application> source code and applies a
|
---|
168 | series of fixes to transform it into valid
|
---|
169 | <application>Python 3.x</application> code.
|
---|
170 | </para>
|
---|
171 | <indexterm zone="ch-system-Python">
|
---|
172 | <primary sortas="b-2to3">2to3</primary>
|
---|
173 | </indexterm>
|
---|
174 | </listitem>
|
---|
175 | </varlistentry>
|
---|
176 |
|
---|
177 | <varlistentry id="idle3">
|
---|
178 | <term><command>idle3</command></term>
|
---|
179 | <listitem>
|
---|
180 | <para>
|
---|
181 | is a wrapper script that opens a <application>Python</application>
|
---|
182 | aware GUI editor. For this script to run, you must have installed
|
---|
183 | <application>Tk</application> before Python so that the Tkinter
|
---|
184 | Python module is built.
|
---|
185 | </para>
|
---|
186 | <indexterm zone="ch-system-Python">
|
---|
187 | <primary sortas="b-idle3">idle3</primary>
|
---|
188 | </indexterm>
|
---|
189 | </listitem>
|
---|
190 | </varlistentry>
|
---|
191 |
|
---|
192 | <varlistentry id="pydoc3">
|
---|
193 | <term><command>pydoc3</command></term>
|
---|
194 | <listitem>
|
---|
195 | <para>
|
---|
196 | is the <application>Python</application> documentation tool.
|
---|
197 | </para>
|
---|
198 | <indexterm zone="ch-system-Python">
|
---|
199 | <primary sortas="b-pydoc3">pydoc3</primary>
|
---|
200 | </indexterm>
|
---|
201 | </listitem>
|
---|
202 | </varlistentry>
|
---|
203 |
|
---|
204 | <varlistentry id="python3">
|
---|
205 | <term><command>python3</command></term>
|
---|
206 | <listitem>
|
---|
207 | <para>
|
---|
208 | is an interpreted, interactive, object-oriented programming
|
---|
209 | language.
|
---|
210 | </para>
|
---|
211 | <indexterm zone="ch-system-Python">
|
---|
212 | <primary sortas="b-python3">python3</primary>
|
---|
213 | </indexterm>
|
---|
214 | </listitem>
|
---|
215 | </varlistentry>
|
---|
216 |
|
---|
217 | <varlistentry id="pyvenv">
|
---|
218 | <term><command>pyvenv</command></term>
|
---|
219 | <listitem>
|
---|
220 | <para>
|
---|
221 | creates virtual <application>Python</application> environments in
|
---|
222 | one or more target directories.
|
---|
223 | </para>
|
---|
224 | <indexterm zone="ch-system-Python">
|
---|
225 | <primary sortas="b-pyvenv">pyvenv</primary>
|
---|
226 | </indexterm>
|
---|
227 | </listitem>
|
---|
228 | </varlistentry>
|
---|
229 |
|
---|
230 | </variablelist>
|
---|
231 |
|
---|
232 | </sect2>
|
---|
233 |
|
---|
234 | </sect1>
|
---|
235 |
|
---|