source: general/prog/python3.xml@ f2e7e668

10.0 10.1 11.0 11.1 11.2 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind lazarus perl-modules plabs/python-mods qt5new trunk upgradedb xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since f2e7e668 was f2e7e668, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

python3-3.6.3

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@19331 af4574ff-66df-0310-9fd7-8a98e5e911e0

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