source: general/prog/python3.xml@ 4a80a67

10.1 11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 4a80a67 was 23ce4179, checked in by Bruce Dubbs <bdubbs@…>, 3 years ago

Update to p11-kit-0.23.22 (security update).
Update to boost-1.75.0.
Update to Python-3.9.1.
Update to libcap-2.46.

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

  • Property mode set to 100644
File size: 12.3 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 "61981498e75ac8f00adcb908281fadb6">
11 <!ENTITY python3-size "18 MB">
12 <!ENTITY python3-buildsize "202 MB (add 31 MB for tests)">
13 <!ENTITY python3-time "0.5 SBU (using parallelism=4; add 1.9 SBU for tests, including rebuilding)">
14 <!--
15 Note: Size does not reflect docs that were install in LFS.
16
17 <!ENTITY python3htmldoc-download-http
18 "https://docs.python.org/ftp/python/doc/&python3-version;/python-&python3-version;-docs-html.tar.bz2"> -->
19]>
20
21<sect1 id="python3" xreflabel="Python-&python3-version;">
22 <?dbhtml filename="python3.html" ?>
23
24 <sect1info>
25 <othername>$LastChangedBy$</othername>
26 <date>$Date$</date>
27 </sect1info>
28
29 <title>Python-&python3-version;</title>
30
31 <indexterm zone="python3">
32 <primary sortas="a-Python3">Python3</primary>
33 </indexterm>
34
35 <sect2 role="package">
36 <title>Introduction to Python 3</title>
37
38 <para>
39 The <application>Python 3</application> package contains the
40 <application>Python</application> development environment.
41 This is useful for object-oriented programming, writing scripts,
42 prototyping large programs or developing entire applications.
43 </para>
44
45 <note>
46 <para>
47 <application>Python 3</application> was installed in LFS.
48 The only reason to rebuild it here is if optional modules
49 are needed.
50 </para>
51 </note>
52
53 &lfs10_checked;
54
55 <bridgehead renderas="sect3">Package Information</bridgehead>
56 <itemizedlist spacing="compact">
57 <listitem>
58 <para>
59 Download (HTTP): <ulink url="&python3-download-http;"/>
60 </para>
61 </listitem>
62 <listitem>
63 <para>
64 Download (FTP): <ulink url="&python3-download-ftp;"/>
65 </para>
66 </listitem>
67 <listitem>
68 <para>
69 Download MD5 sum: &python3-md5sum;
70 </para>
71 </listitem>
72 <listitem>
73 <para>
74 Download size: &python3-size;
75 </para>
76 </listitem>
77 <listitem>
78 <para>
79 Estimated disk space required: &python3-buildsize;
80 </para>
81 </listitem>
82 <listitem>
83 <para>
84 Estimated build time: &python3-time;
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="sqlite"/> (required if building firefox or thunderbird)
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),
100 <xref linkend="valgrind"/>, and
101 <ulink url="http://www.bytereef.org/mpdecimal">libmpdec</ulink>
102 </para>
103
104 <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
105 <para role="optional">
106 <xref linkend="db"/> and
107 <xref linkend="tk"/>
108 </para>
109
110 <para condition="html" role="usernotes">User Notes:
111 <ulink url="&blfs-wiki;/Python3"/>
112 </para>
113 </sect2>
114
115 <sect2 role="installation">
116 <title>Installation of Python 3</title>
117
118 <para>
119 Install <application>Python 3</application> by running the following
120 commands:
121 </para>
122
123<screen><userinput>CXX="/usr/bin/g++" \
124./configure --prefix=/usr \
125 --enable-shared \
126 --with-system-expat \
127 --with-system-ffi \
128 --with-ensurepip=yes &amp;&amp;
129make</userinput></screen>
130
131 <para>
132 The test suite must be run separately, using an X terminal (see below).
133 </para>
134
135 <para>
136 Now, as the <systemitem class="username">root</systemitem> user:
137 </para>
138
139<screen role="root"><userinput>make install</userinput></screen>
140
141 <para>
142 The test suite must be run separately from the build, either before or
143 after the package is built and installed. Do not run
144 <command>make install</command> after running the test suite. To build
145 and install the package, you need to start with a fresh or clean source
146 tree. For the tests, you also need a clean source code, so either start by
147 removing the source code directory and starting over, by uncompressing
148 the source tarball or by running <command>make clean</command>. Then
149 configure again, adding <quote>--with-pydebug</quote> to the
150 <command>configure</command> switches above, run <command>make</command>,
151 then <command>make test</command>. Remember that tests must be executed
152 using an X terminal.
153 The test SBU highly depends on the speed of the internet connection.
154 </para>
155
156 </sect2>
157
158 <sect2 role="commands">
159 <title>Command Explanations</title>
160
161 <para>
162 <command> CXX="/usr/bin/g++" ./configure ...</command>: Avoid an annoying
163 message during configuration.
164 </para>
165
166 <para>
167 <parameter>--with-system-expat</parameter>: This switch enables linking
168 against the system version of <application>Expat</application>.
169 </para>
170
171 <para>
172 <parameter>--with-system-ffi</parameter>: This switch enables linking
173 against system version of <application>libffi</application>.
174 </para>
175
176 <para>
177 <parameter>--with-ensurepip=yes</parameter> : This switch enables building
178 <command>pip</command> and <command>setuptools</command> packaging programs.
179 <command>setuptools</command> is needed for building some Python modules.
180 </para>
181
182 <para>
183 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
184 if you want to build <application>Python</application> DBM Module
185 against <application>Berkeley DB</application> instead of
186 <application>GDBM</application>.
187 </para>
188
189 <para>
190 <option>--enable-optimization</option>: Use this switch
191 if you want to enable <emphasis>expensive</emphasis> optimizations (i.e.
192 Profile Guided Optimizations). This adds around 20 SBU, but can
193 <emphasis>slightly</emphasis> speed up some uses, such as using
194 <application>Sphinx</application> for creating documentation, or use of
195 <application>Python3</application> scripts.
196 </para>
197
198 <para>
199 <option>--with-lto</option>: This optional switch enables thick Link
200 Time Optimization. Unusually, it creates a much larger <filename
201 class="libraryfile">/usr/lib/python&python3-majorver;/config-&python3-majorver;-&lt;arch&gt;-linux-gnu/libpython&python3-majorver;.a</filename>
202 with a small increase in the time to compile
203 <application>Python</application>. Run-time results do not appear to show
204 any benefit from doing this.
205 </para>
206 <!--
207 <para>
208 <command>ln -sfv ...</command>: When upgrading to Python-3.8, it was
209 discovered that the symlink to pip3 is sometimes not created. Create
210 the symlink so that pip3 can be used as described in the book.
211 </para>
212 -->
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) and
246 2to3-&python3-majorver;,
247
248 easy_install-&python3-majorver;,
249
250 idle3 (symlink) and
251 idle&python3-majorver;,
252
253 pip3 (symlink) and
254 pip&python3-majorver;,
255
256 pydoc3 and
257 pydoc&python3-majorver;,
258
259 python3 (symlink);
260 python&python3-majorver;, and
261
262 python3 (symlink), and
263 python&python3-majorver;
264
265 python3-config (symlink) and
266 python&python3-majorver;-config
267 </seg>
268 <seg>
269 libpython&python3-majorver;.so and libpython3.so
270 </seg>
271 <seg>
272 /usr/include/python&python3-majorver;,
273 /usr/lib/python&python3-majorver;, and
274 /usr/share/doc/python-&python3-version;
275 </seg>
276 </seglistitem>
277 </segmentedlist>
278
279 <variablelist>
280 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
281 <?dbfo list-presentation="list"?>
282 <?dbhtml list-presentation="table"?>
283 <!--
284 <varlistentry id="2to3">
285 <term><command>2to3</command></term>
286 <listitem>
287 <para>
288 is designed to assist in the transition between python2 and python3
289 by automatically converting code to be Python3 compatible.
290 </para>
291 <indexterm zone="python3 2to3">
292 <primary sortas="b-2to3">2to3</primary>
293 </indexterm>
294 </listitem>
295 </varlistentry>
296 Put here for easy use when removing Python2 -->
297 <varlistentry id="easy_install">
298 <term><command>easy_install</command></term>
299 <listitem>
300 <para>
301 is a frontend to pip3 to make it easier to configure python modules
302 through the PIP package manager.
303 </para>
304 <indexterm zone="python3 easy_install">
305 <primary sortas="python3 easy_install">easy_install</primary>
306 </indexterm>
307 </listitem>
308 </varlistentry>
309
310 <varlistentry id="idle3">
311 <term><command>idle3</command></term>
312 <listitem>
313 <para>
314 is a wrapper script that opens a <application>Python</application>
315 aware GUI editor. For this script to run, you must have installed
316 <application>Tk</application> before Python so that the Tkinter
317 Python module is built.
318 </para>
319 <indexterm zone="python3 idle3">
320 <primary sortas="b-idle3">idle3</primary>
321 </indexterm>
322 </listitem>
323 </varlistentry>
324
325 <varlistentry id="pydoc3">
326 <term><command>pydoc3</command></term>
327 <listitem>
328 <para>
329 is the <application>Python</application> documentation
330 tool.
331 </para>
332 <indexterm zone="python3 pydoc3">
333 <primary sortas="b-pydoc3">pydo3c</primary>
334 </indexterm>
335 </listitem>
336 </varlistentry>
337
338 <varlistentry id="python3-prog">
339 <term><command>python3</command></term>
340 <listitem>
341 <para>
342 is an interpreted, interactive, object-oriented programming
343 language.
344 </para>
345 <indexterm zone="python3 python3-prog">
346 <primary sortas="b-python3">python3</primary>
347 </indexterm>
348 </listitem>
349 </varlistentry>
350
351 <varlistentry id="python-ver">
352 <term><command>python&python3-majorver;</command></term>
353 <listitem>
354 <para>
355 is a version-specific name for the <command>python</command>
356 program.
357 </para>
358 <indexterm zone="python3 python-ver">
359 <primary
360 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
361 </indexterm>
362 </listitem>
363 </varlistentry>
364 <!--
365 <varlistentry id="pyvenv">
366 <term><command>pyvenv</command></term>
367 <listitem>
368 <para>
369 creates virtual <application>Python</application> environments in
370 one or more target directories.
371 </para>
372 <indexterm zone="python3 pyvenv">
373 <primary
374 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
375 </indexterm>
376 </listitem>
377 </varlistentry>
378 -->
379 </variablelist>
380
381 </sect2>
382
383</sect1>
Note: See TracBrowser for help on using the repository browser.