source: general/prog/python3.xml@ 2cb9c19

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

Update to btrfs-progs-v5.9.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@23840 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 "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
215 </sect2>
216
217 <sect2 role="configuration">
218 <title>Configuring Python 3</title>
219
220 <para>
221 In order for <command>python3</command> to find the installed
222 documentation, create the following version independent symlink:
223 </para>
224
225<screen role="root"><userinput>ln -svfn python-&python3-version; /usr/share/doc/python-3</userinput></screen>
226
227 <para>
228 and add the following environment variable to the individual user's or
229 system's profile:
230 </para>
231
232<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-3/html</userinput></screen>
233
234 </sect2>
235
236 <sect2 role="content">
237 <title>Contents</title>
238
239 <segmentedlist>
240 <segtitle>Installed Programs</segtitle>
241 <segtitle>Installed Libraries</segtitle>
242 <segtitle>Installed Directories</segtitle>
243
244 <seglistitem>
245 <seg>
246 2to3 (symlink) and
247 2to3-&python3-majorver;,
248
249 easy_install-&python3-majorver;,
250
251 idle3 (symlink) and
252 idle&python3-majorver;,
253
254 pip3 (symlink) and
255 pip&python3-majorver;,
256
257 pydoc3 and
258 pydoc&python3-majorver;,
259
260 python3 (symlink);
261 python&python3-majorver;, and
262
263 python3 (symlink), and
264 python&python3-majorver;
265
266 python3-config (symlink) and
267 python&python3-majorver;-config
268 </seg>
269 <seg>
270 libpython&python3-majorver;.so and libpython3.so
271 </seg>
272 <seg>
273 /usr/include/python&python3-majorver;,
274 /usr/lib/python&python3-majorver;, and
275 /usr/share/doc/python-&python3-version;
276 </seg>
277 </seglistitem>
278 </segmentedlist>
279
280 <variablelist>
281 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
282 <?dbfo list-presentation="list"?>
283 <?dbhtml list-presentation="table"?>
284 <!--
285 <varlistentry id="2to3">
286 <term><command>2to3</command></term>
287 <listitem>
288 <para>
289 is designed to assist in the transition between python2 and python3
290 by automatically converting code to be Python3 compatible.
291 </para>
292 <indexterm zone="python3 2to3">
293 <primary sortas="b-2to3">2to3</primary>
294 </indexterm>
295 </listitem>
296 </varlistentry>
297 Put here for easy use when removing Python2 -->
298 <varlistentry id="easy_install">
299 <term><command>easy_install</command></term>
300 <listitem>
301 <para>
302 is a frontend to pip3 to make it easier to configure python modules
303 through the PIP package manager.
304 </para>
305 <indexterm zone="python3 easy_install">
306 <primary sortas="python3 easy_install">easy_install</primary>
307 </indexterm>
308 </listitem>
309 </varlistentry>
310
311 <varlistentry id="idle3">
312 <term><command>idle3</command></term>
313 <listitem>
314 <para>
315 is a wrapper script that opens a <application>Python</application>
316 aware GUI editor. For this script to run, you must have installed
317 <application>Tk</application> before Python so that the Tkinter
318 Python module is built.
319 </para>
320 <indexterm zone="python3 idle3">
321 <primary sortas="b-idle3">idle3</primary>
322 </indexterm>
323 </listitem>
324 </varlistentry>
325
326 <varlistentry id="pydoc3">
327 <term><command>pydoc3</command></term>
328 <listitem>
329 <para>
330 is the <application>Python</application> documentation
331 tool.
332 </para>
333 <indexterm zone="python3 pydoc3">
334 <primary sortas="b-pydoc3">pydo3c</primary>
335 </indexterm>
336 </listitem>
337 </varlistentry>
338
339 <varlistentry id="python3-prog">
340 <term><command>python3</command></term>
341 <listitem>
342 <para>
343 is an interpreted, interactive, object-oriented programming
344 language.
345 </para>
346 <indexterm zone="python3 python3-prog">
347 <primary sortas="b-python3">python3</primary>
348 </indexterm>
349 </listitem>
350 </varlistentry>
351
352 <varlistentry id="python-ver">
353 <term><command>python&python3-majorver;</command></term>
354 <listitem>
355 <para>
356 is a version-specific name for the <command>python</command>
357 program.
358 </para>
359 <indexterm zone="python3 python-ver">
360 <primary
361 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
362 </indexterm>
363 </listitem>
364 </varlistentry>
365 <!--
366 <varlistentry id="pyvenv">
367 <term><command>pyvenv</command></term>
368 <listitem>
369 <para>
370 creates virtual <application>Python</application> environments in
371 one or more target directories.
372 </para>
373 <indexterm zone="python3 pyvenv">
374 <primary
375 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
376 </indexterm>
377 </listitem>
378 </varlistentry>
379 -->
380 </variablelist>
381
382 </sect2>
383
384</sect1>
Note: See TracBrowser for help on using the repository browser.