source: general/prog/python3.xml@ 4873baa

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 4873baa was 4873baa, checked in by Bruce Dubbs <bdubbs@…>, 4 years ago

Update to libcap-2.44.
Update to Python-3.9.0.
Update to mesa-20.2.1.

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

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