source: general/prog/python3.xml@ 5ab87cfa

10.0 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 5ab87cfa was bcc6fd4, checked in by Douglas R. Reno <renodr@…>, 4 years ago

python3: remove lsb-tools dependency that I added when Python-3.8 was first added

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

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