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 | <!ENTITY python3-download-http
|
---|
8 | "https://www.python.org/ftp/python/&python3-version;/Python-&python3-version;.tar.xz">
|
---|
9 | <!ENTITY python3-download-ftp " ">
|
---|
10 | <!ENTITY python3-md5sum "692b4fc3a2ba0d54d1495d4ead5b0b5c">
|
---|
11 | <!ENTITY python3-size "16 MB">
|
---|
12 | <!ENTITY python3-buildsize "355 MB (with docs; add 25 MB for the tests)">
|
---|
13 | <!ENTITY python3-time "1.3 SBU (add 0.6 SBU for the tests)">
|
---|
14 |
|
---|
15 | <!ENTITY python3htmldoc-download-http
|
---|
16 | "https://docs.python.org/&python3-majorver;/archives/python-&python3-version;-docs-html.tar.bz2">
|
---|
17 | ]>
|
---|
18 |
|
---|
19 | <sect1 id="python3" xreflabel="Python-&python3-version;">
|
---|
20 | <?dbhtml filename="python3.html" ?>
|
---|
21 |
|
---|
22 | <sect1info>
|
---|
23 | <othername>$LastChangedBy$</othername>
|
---|
24 | <date>$Date$</date>
|
---|
25 | </sect1info>
|
---|
26 |
|
---|
27 | <title>Python-&python3-version;</title>
|
---|
28 |
|
---|
29 | <indexterm zone="python3">
|
---|
30 | <primary sortas="a-Python3">Python3</primary>
|
---|
31 | </indexterm>
|
---|
32 |
|
---|
33 | <sect2 role="package">
|
---|
34 | <title>Introduction to Python 3</title>
|
---|
35 |
|
---|
36 | <para>
|
---|
37 | The <application>Python 3</application> package contains the
|
---|
38 | <application>Python</application> development environment.
|
---|
39 | This is useful for object-oriented programming, writing scripts,
|
---|
40 | prototyping large programs or developing entire applications.
|
---|
41 | </para>
|
---|
42 |
|
---|
43 | &lfs80_checked;
|
---|
44 |
|
---|
45 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
46 | <itemizedlist spacing="compact">
|
---|
47 | <listitem>
|
---|
48 | <para>
|
---|
49 | Download (HTTP): <ulink url="&python3-download-http;"/>
|
---|
50 | </para>
|
---|
51 | </listitem>
|
---|
52 | <listitem>
|
---|
53 | <para>
|
---|
54 | Download (FTP): <ulink url="&python3-download-ftp;"/>
|
---|
55 | </para>
|
---|
56 | </listitem>
|
---|
57 | <listitem>
|
---|
58 | <para>
|
---|
59 | Download MD5 sum: &python3-md5sum;
|
---|
60 | </para>
|
---|
61 | </listitem>
|
---|
62 | <listitem>
|
---|
63 | <para>
|
---|
64 | Download size: &python3-size;
|
---|
65 | </para>
|
---|
66 | </listitem>
|
---|
67 | <listitem>
|
---|
68 | <para>
|
---|
69 | Estimated disk space required: &python3-buildsize;
|
---|
70 | </para>
|
---|
71 | </listitem>
|
---|
72 | <listitem>
|
---|
73 | <para>
|
---|
74 | Estimated build time: &python3-time;
|
---|
75 | </para>
|
---|
76 | </listitem>
|
---|
77 | </itemizedlist>
|
---|
78 |
|
---|
79 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
80 | <itemizedlist spacing="compact">
|
---|
81 | <title>Optional HTML Documentation</title>
|
---|
82 | <listitem>
|
---|
83 | <para>
|
---|
84 | Download (HTTP): <ulink url="&python3htmldoc-download-http;"/>
|
---|
85 | </para>
|
---|
86 | </listitem>
|
---|
87 | </itemizedlist>
|
---|
88 |
|
---|
89 | <bridgehead renderas="sect3">Python 3 Dependencies</bridgehead>
|
---|
90 |
|
---|
91 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
92 | <para role="recommended">
|
---|
93 | <xref linkend="libffi"/>
|
---|
94 | </para>
|
---|
95 |
|
---|
96 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
97 | <para role="optional">
|
---|
98 | <xref linkend="bluez"/>,
|
---|
99 | <xref linkend="gdb"/> (required for some tests), and
|
---|
100 | <xref linkend="valgrind"/>
|
---|
101 | </para>
|
---|
102 |
|
---|
103 | <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
|
---|
104 | <para role="optional">
|
---|
105 | <xref linkend="db"/>,
|
---|
106 | <xref linkend="openssl"/>,
|
---|
107 | <xref linkend="sqlite"/> and
|
---|
108 | <xref linkend="tk"/>
|
---|
109 | </para>
|
---|
110 |
|
---|
111 | <para condition="html" role="usernotes">User Notes:
|
---|
112 | <ulink url="&blfs-wiki;/Python3"/>
|
---|
113 | </para>
|
---|
114 | </sect2>
|
---|
115 |
|
---|
116 | <sect2 role="installation">
|
---|
117 | <title>Installation of Python 3</title>
|
---|
118 |
|
---|
119 | <para>
|
---|
120 | Install <application>Python 3</application> by running the following
|
---|
121 | commands:
|
---|
122 | </para>
|
---|
123 |
|
---|
124 | <screen><userinput>CXX="/usr/bin/g++" \
|
---|
125 | ./configure --prefix=/usr \
|
---|
126 | --enable-shared \
|
---|
127 | --with-system-expat \
|
---|
128 | --with-system-ffi \
|
---|
129 | --with-ensurepip=yes &&
|
---|
130 | make</userinput></screen>
|
---|
131 |
|
---|
132 | <para>
|
---|
133 | The test suite must be run separately, using an X terminal (see below).
|
---|
134 | </para>
|
---|
135 |
|
---|
136 | <para>
|
---|
137 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
138 | </para>
|
---|
139 |
|
---|
140 | <screen role="root"><userinput>make install &&
|
---|
141 | chmod -v 755 /usr/lib/libpython&python3-majorver;m.so &&
|
---|
142 | chmod -v 755 /usr/lib/libpython3.so</userinput></screen>
|
---|
143 |
|
---|
144 | <para>
|
---|
145 | If you have downloaded the preformatted documentation from
|
---|
146 | <ulink url="http://docs.python.org/download.html"/>, install it
|
---|
147 | as the <systemitem class="username">root</systemitem> user:
|
---|
148 | </para>
|
---|
149 |
|
---|
150 | <screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python3-version;/html &&
|
---|
151 | tar --strip-components=1 \
|
---|
152 | --no-same-owner \
|
---|
153 | --no-same-permissions \
|
---|
154 | -C /usr/share/doc/python-&python3-version;/html \
|
---|
155 | -xvf ../python-&python3-version;-docs-html.tar.bz2</userinput></screen>
|
---|
156 |
|
---|
157 | <para>
|
---|
158 | The test suite must be run separately from the build, either before or
|
---|
159 | after the package is built and installed. Do not run
|
---|
160 | <command>make install</command>, after running the test suite. To build
|
---|
161 | and install the package, you need to start with a fresh or clean source
|
---|
162 | tree. For the test, you also need a clean source code, so either start by
|
---|
163 | removing the source code directory and starting over, by uncompressing
|
---|
164 | the source tarball or by running <command>make clean</command>. Then
|
---|
165 | configure again, adding <quote>--with-pydebug</quote> to the
|
---|
166 | <command>configure</command> switches above, run <command>make</command>,
|
---|
167 | then <command>make test</command>. Remember that tests must be executed
|
---|
168 | using an X terminal.
|
---|
169 | </para>
|
---|
170 |
|
---|
171 | </sect2>
|
---|
172 |
|
---|
173 | <sect2 role="commands">
|
---|
174 | <title>Command Explanations</title>
|
---|
175 |
|
---|
176 | <para>
|
---|
177 | <command> CXX="/usr/bin/g++" ./configure ...</command>: Avoid an annoying
|
---|
178 | message during configuration.
|
---|
179 | </para>
|
---|
180 |
|
---|
181 | <para>
|
---|
182 | <parameter>--with-system-expat</parameter>: This switch enables linking
|
---|
183 | against the system version of <application>Expat</application>.
|
---|
184 | </para>
|
---|
185 |
|
---|
186 | <para>
|
---|
187 | <parameter>--with-system-ffi</parameter>: This switch enables linking
|
---|
188 | against system version of <application>libffi</application>. Remove if
|
---|
189 | you have not installed <xref linkend="libffi"/>.
|
---|
190 | </para>
|
---|
191 |
|
---|
192 | <para>
|
---|
193 | <parameter>--with-ensurepip=yes</parameter> : This switch enables building
|
---|
194 | <command>pip</command> and <command>setuptools</command> packaging programs.
|
---|
195 | <command>setuptools</command> is needed for building some Python modules.
|
---|
196 | </para>
|
---|
197 |
|
---|
198 | <para>
|
---|
199 | <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
|
---|
200 | if you want to build <application>Python</application> DBM Module
|
---|
201 | against <application>Berkeley DB</application> instead of
|
---|
202 | <application>GDBM</application>.
|
---|
203 | </para>
|
---|
204 |
|
---|
205 | <para>
|
---|
206 | <command>chmod ...</command>: Fix permissions for shared libraries to be
|
---|
207 | consistent with other libraries.
|
---|
208 | </para>
|
---|
209 |
|
---|
210 | </sect2>
|
---|
211 |
|
---|
212 | <sect2 role="configuration">
|
---|
213 | <title>Configuring Python 3</title>
|
---|
214 |
|
---|
215 | <para>
|
---|
216 | In order for <command>python3</command> to find the installed
|
---|
217 | documentation, create the following version independent symlink:
|
---|
218 | </para>
|
---|
219 |
|
---|
220 | <screen role="root"><userinput>ln -svfn python-&python3-version; /usr/share/doc/python-3</userinput></screen>
|
---|
221 |
|
---|
222 | <para>
|
---|
223 | and add the following environment variable to the individual user's or
|
---|
224 | system's profile:
|
---|
225 | </para>
|
---|
226 |
|
---|
227 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-3/html</userinput></screen>
|
---|
228 |
|
---|
229 | </sect2>
|
---|
230 |
|
---|
231 | <sect2 role="content">
|
---|
232 | <title>Contents</title>
|
---|
233 |
|
---|
234 | <segmentedlist>
|
---|
235 | <segtitle>Installed Programs</segtitle>
|
---|
236 | <segtitle>Installed Libraries</segtitle>
|
---|
237 | <segtitle>Installed Directories</segtitle>
|
---|
238 |
|
---|
239 | <seglistitem>
|
---|
240 | <seg>
|
---|
241 | 2to3 (symlink),
|
---|
242 | 2to3-&python3-majorver;,
|
---|
243 |
|
---|
244 | pydoc3 (symlink),
|
---|
245 | pydoc&python3-majorver;,
|
---|
246 |
|
---|
247 | python3 (symlink);
|
---|
248 | python&python3-majorver; and python&python3-majorver;m (hardlinked);
|
---|
249 |
|
---|
250 | python3-config (symlink),
|
---|
251 | python&python3-majorver;-config (symlink),
|
---|
252 | python&python3-majorver;m-config,
|
---|
253 |
|
---|
254 | pyvenv (symlink),
|
---|
255 | pyvenv-&python3-majorver;,
|
---|
256 |
|
---|
257 | idle3 (symlink), and
|
---|
258 | idle&python3-majorver;
|
---|
259 | </seg>
|
---|
260 | <seg>
|
---|
261 | libpython&python3-majorver;m.so and libpython3.so
|
---|
262 | </seg>
|
---|
263 | <seg>
|
---|
264 | /usr/include/python&python3-majorver;m,
|
---|
265 | /usr/lib/python&python3-majorver;, and
|
---|
266 | /usr/share/doc/python-&python3-version;
|
---|
267 | </seg>
|
---|
268 | </seglistitem>
|
---|
269 | </segmentedlist>
|
---|
270 |
|
---|
271 | <variablelist>
|
---|
272 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
273 | <?dbfo list-presentation="list"?>
|
---|
274 | <?dbhtml list-presentation="table"?>
|
---|
275 |
|
---|
276 | <varlistentry id="idle3">
|
---|
277 | <term><command>idle3</command></term>
|
---|
278 | <listitem>
|
---|
279 | <para>
|
---|
280 | is a wrapper script that opens a <application>Python</application>
|
---|
281 | aware GUI editor. For this script to run, you must have installed
|
---|
282 | <application>Tk</application> before Python so that the Tkinter
|
---|
283 | Python module is built.
|
---|
284 | </para>
|
---|
285 | <indexterm zone="python3 idle3">
|
---|
286 | <primary sortas="b-idle3">idle3</primary>
|
---|
287 | </indexterm>
|
---|
288 | </listitem>
|
---|
289 | </varlistentry>
|
---|
290 |
|
---|
291 | <varlistentry id="pydoc3">
|
---|
292 | <term><command>pydoc3</command></term>
|
---|
293 | <listitem>
|
---|
294 | <para>
|
---|
295 | is the <application>Python</application> documentation
|
---|
296 | tool.
|
---|
297 | </para>
|
---|
298 | <indexterm zone="python3 pydoc3">
|
---|
299 | <primary sortas="b-pydoc3">pydo3c</primary>
|
---|
300 | </indexterm>
|
---|
301 | </listitem>
|
---|
302 | </varlistentry>
|
---|
303 |
|
---|
304 | <varlistentry id="python3-prog">
|
---|
305 | <term><command>python3</command></term>
|
---|
306 | <listitem>
|
---|
307 | <para>
|
---|
308 | is an interpreted, interactive, object-oriented programming
|
---|
309 | language.
|
---|
310 | </para>
|
---|
311 | <indexterm zone="python3 python3-prog">
|
---|
312 | <primary sortas="b-python3">python3</primary>
|
---|
313 | </indexterm>
|
---|
314 | </listitem>
|
---|
315 | </varlistentry>
|
---|
316 |
|
---|
317 | <varlistentry id="python-ver">
|
---|
318 | <term><command>python&python3-majorver;</command></term>
|
---|
319 | <listitem>
|
---|
320 | <para>
|
---|
321 | is a version-specific name for the <command>python</command>
|
---|
322 | program.
|
---|
323 | </para>
|
---|
324 | <indexterm zone="python3 python-ver">
|
---|
325 | <primary
|
---|
326 | sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
|
---|
327 | </indexterm>
|
---|
328 | </listitem>
|
---|
329 | </varlistentry>
|
---|
330 |
|
---|
331 | <varlistentry id="pyvenv">
|
---|
332 | <term><command>pyvenv</command></term>
|
---|
333 | <listitem>
|
---|
334 | <para>
|
---|
335 | creates virtual <application>Python</application> environments in
|
---|
336 | one or more target directories.
|
---|
337 | </para>
|
---|
338 | <indexterm zone="python3 pyvenv">
|
---|
339 | <primary
|
---|
340 | sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
|
---|
341 | </indexterm>
|
---|
342 | </listitem>
|
---|
343 | </varlistentry>
|
---|
344 |
|
---|
345 | </variablelist>
|
---|
346 |
|
---|
347 | </sect2>
|
---|
348 |
|
---|
349 | </sect1>
|
---|