source: general/prog/python3.xml@ ea3ad858

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 xry111/llvm18 xry111/xf86-video-removal
Last change on this file since ea3ad858 was ea3ad858, checked in by Douglas R. Reno <renodr@…>, 18 months ago

Python3's module reinstallation instructions:

Add meson into the list for both init systems

On systemd, mention MarkupSafe and Jinja2 from LFS as well.

There is a really long list of affected packages in IRC. We should come
up with a better way of handling this, I feel like the list would be too
long if we added it in normally.

  • Property mode set to 100644
File size: 13.0 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 "fe92acfa0db9b9f5044958edb451d463">
11 <!ENTITY python3-size "19 MB">
12 <!ENTITY python3-buildsize "282 MB (add 63 MB for tests)">
13 <!ENTITY python3-time "2.1 SBU (add 1.2 SBU for tests; both using parallelism=4)">
14 <!--
15 Note: Size does not reflect docs that were install in LFS.
16 -->
17 <!ENTITY python3htmldoc-download-http
18 "https://www.python.org/ftp/python/doc/&python3-version;/python-&python3-version;-docs-html.tar.bz2">
19 <!ENTITY python3-docs-md5sum "b740495c9f6714e0998894ed8d1cb379" >
20]>
21
22<sect1 id="python3" xreflabel="Python-&python3-version;">
23 <?dbhtml filename="python3.html" ?>
24
25 <sect1info>
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, or to upgrade this package.
50 </para>
51 </note>
52
53 &lfs112_checked;
54
55 <important>
56 <para>
57 If upgrading to a new Python-3 minor version (for example,
58 from Python-3.10.x to Python-3.11.0), you will need to reinstall
59 any Python3 modules you have installed. You should also
60 reinstall packages that generate Python3 modules
61 including
62 <xref linkend="gobject-introspection"/>,
63 <xref linkend="opencv"/>,
64 <xref linkend="swig"/>, and
65 <xref linkend="graphviz"/> (after swig).
66 </para>
67
68 <para>
69 The wheel module and meson from LFS will also have to be reinstalled:
70 <ulink url="https://www.linuxfromscratch.org/lfs/view/development/chapter08/wheel.html"/> and
71 <ulink url="https://www.linuxfromscratch.org/lfs/view/development/chapter08/meson.html"/>.
72 </para>
73
74 <para revision="systemd">
75 On systemd systems, it is also necessary to reinstall the MarkupSafe
76 and Jinja2 modules from LFS:
77 <ulink url="https://www.linuxfromscratch.org/lfs/view/systemd/chapter08/markupsafe.html"/> and
78 <ulink url="https://www.linuxfromscratch.org/lfs/view/systemd/chapter08/jinja2.html"/>.
79 </para>
80 </important>
81
82 <bridgehead renderas="sect3">Package Information</bridgehead>
83 <itemizedlist spacing="compact">
84 <listitem>
85 <para>
86 Download (HTTP): <ulink url="&python3-download-http;"/>
87 </para>
88 </listitem>
89 <listitem>
90 <para>
91 Download (FTP): <ulink url="&python3-download-ftp;"/>
92 </para>
93 </listitem>
94 <listitem>
95 <para>
96 Download MD5 sum: &python3-md5sum;
97 </para>
98 </listitem>
99 <listitem>
100 <para>
101 Download size: &python3-size;
102 </para>
103 </listitem>
104 <listitem>
105 <para>
106 Estimated disk space required: &python3-buildsize;
107 </para>
108 </listitem>
109 <listitem>
110 <para>
111 Estimated build time: &python3-time;
112 </para>
113 </listitem>
114 </itemizedlist>
115
116 <bridgehead renderas="sect3">Additional Optional Download</bridgehead>
117 <itemizedlist spacing="compact">
118 <listitem>
119 <para>
120 Download (HTTP): <ulink url="&python3htmldoc-download-http;"/>
121 </para>
122 </listitem>
123 <listitem>
124 <para>
125 Download MD5 sum: &python3-docs-md5sum;
126 </para>
127 </listitem>
128 </itemizedlist>
129
130 <bridgehead renderas="sect3">Python 3 Dependencies</bridgehead>
131
132 <bridgehead renderas="sect4">Recommended</bridgehead>
133 <para role="recommended">
134 <xref linkend="sqlite"/> (required if building firefox or thunderbird)
135 </para>
136
137 <bridgehead renderas="sect4">Optional</bridgehead>
138 <para role="optional">
139 <xref linkend="bluez"/>,
140 <xref linkend="gdb"/> (required for some tests),
141 <xref linkend="valgrind"/>, and
142 <ulink url="https://www.bytereef.org/mpdecimal/">libmpdec</ulink>
143 </para>
144
145 <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
146 <para role="optional">
147 <xref linkend="db"/>,
148 <xref linkend="libnsl"/>, and
149 <xref linkend="tk"/>
150 </para>
151
152 <para condition="html" role="usernotes">User Notes:
153 <ulink url="&blfs-wiki;/Python3"/>
154 </para>
155 </sect2>
156
157 <sect2 role="installation">
158 <title>Installation of Python 3</title>
159
160 <para>
161 Install <application>Python 3</application> by running the following
162 commands:
163 </para>
164
165<screen><userinput>CXX="/usr/bin/g++" \
166./configure --prefix=/usr \
167 --enable-shared \
168 --with-system-expat \
169 --with-system-ffi \
170 --enable-optimizations &amp;&amp;
171make</userinput></screen>
172
173 <para>
174 To test the result, issue <command>make test</command>.
175 Some tests may need an Internet connection. <!--Two tests, test_distutils
176 and test_peg_generator are known to fail.-->
177 </para>
178
179 <para>
180 Now, as the <systemitem class="username">root</systemitem> user:
181 </para>
182
183<screen role="root"><userinput>make install</userinput></screen>
184
185 <para>
186 If upgrading and the documentation has been downloaded, optionally install
187 it as the &root; user:
188 </para>
189
190<screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python3-version;/html
191
192tar --strip-components=1 \
193 --no-same-owner \
194 --no-same-permissions \
195 -C /usr/share/doc/python-&python3-version;/html \
196 -xvf ../python-&python3-version;-docs-html.tar.bz2</userinput></screen>
197
198 </sect2>
199
200 <sect2 role="commands">
201 <title>Command Explanations</title>
202
203 <para>
204 <command> CXX="/usr/bin/g++" ./configure ...</command>: Avoid an annoying
205 message during configuration.
206 </para>
207
208 <para>
209 <parameter>--with-system-expat</parameter>: This switch enables linking
210 against the system version of <application>Expat</application>.
211 </para>
212
213 <para>
214 <parameter>--with-system-ffi</parameter>: This switch enables linking
215 against the system version of <application>libffi</application>.
216 </para>
217<!--
218 <para>
219 <parameter>- -with-ensurepip=yes</parameter> : This switch enables building
220 the <command>pip</command> and <command>setuptools</command> packaging
221 programs. <command>setuptools</command> is needed for building some
222 Python modules.
223 </para>
224-->
225 <para>
226 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
227 if you want to build the <application>Python</application> DBM Module
228 against <application>Berkeley DB</application> instead of
229 <application>GDBM</application>.
230 </para>
231
232 <para>
233 <parameter>--enable-optimizations</parameter>: This switch enables
234 stable, but expensive, optimizations.
235 </para>
236
237 <para>
238 <option>--with-lto</option>: This optional switch enables thick Link
239 Time Optimization. Unusually, it creates a much larger <filename
240 class="libraryfile">/usr/lib/python&python3-majorver;/config-&python3-majorver;-&lt;arch&gt;-linux-gnu/libpython&python3-majorver;.a</filename>
241 with a small increase in the time to compile
242 <application>Python</application>. Run-time results do not appear to show
243 any benefit from doing this.
244 </para>
245
246 </sect2>
247
248 <sect2 role="configuration">
249 <title>Configuring Python 3</title>
250
251 <para>
252 In order for <command>python3</command> to find the installed
253 documentation, create the following version independent symlink:
254 </para>
255
256<screen role="root"><userinput>ln -svfn python-&python3-version; /usr/share/doc/python-3</userinput></screen>
257
258 <para>
259 and add the following environment variable to the individual user's or
260 system's profile:
261 </para>
262
263<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-3/html</userinput></screen>
264
265 </sect2>
266
267 <sect2 role="content">
268 <title>Contents</title>
269
270 <segmentedlist>
271 <segtitle>Installed Programs</segtitle>
272 <segtitle>Installed Libraries</segtitle>
273 <segtitle>Installed Directories</segtitle>
274
275 <seglistitem>
276 <seg>
277 2to3 (symlink) and
278 2to3-&python3-majorver;,
279
280 <!--
281 easy_install-&python3-majorver;,
282 -->
283
284 idle3 (symlink) and
285 idle&python3-majorver;,
286
287 pip3 (symlink) and
288 pip&python3-majorver;,
289
290 pydoc3 and
291 pydoc&python3-majorver;,
292
293 python3 (symlink);
294 python&python3-majorver;, and
295
296 python3-config (symlink) and
297 python&python3-majorver;-config
298 </seg>
299 <seg>
300 libpython&python3-majorver;.so and libpython3.so
301 </seg>
302 <seg>
303 /usr/include/python&python3-majorver;,
304 /usr/lib/python&python3-majorver;, and
305 /usr/share/doc/python-&python3-version;
306 </seg>
307 </seglistitem>
308 </segmentedlist>
309
310 <variablelist>
311 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
312 <?dbfo list-presentation="list"?>
313 <?dbhtml list-presentation="table"?>
314 <!--
315 <varlistentry id="2to3">
316 <term><command>2to3</command></term>
317 <listitem>
318 <para>
319 is designed to assist in the transition between python2 and python3
320 by automatically converting code to be Python3 compatible.
321 </para>
322 <indexterm zone="python3 2to3">
323 <primary sortas="b-2to3">2to3</primary>
324 </indexterm>
325 </listitem>
326 </varlistentry>
327 Put here for easy use when removing Python2 -->
328 <!--
329 <varlistentry id="easy_install">
330 <term><command>easy_install</command></term>
331 <listitem>
332 <para>
333 is a frontend to pip3 to make it easier to configure python modules
334 through the PIP package manager
335 </para>
336 <indexterm zone="python3 easy_install">
337 <primary sortas="python3 easy_install">easy_install</primary>
338 </indexterm>
339 </listitem>
340 </varlistentry>
341 -->
342 <varlistentry id="idle3">
343 <term><command>idle3</command></term>
344 <listitem>
345 <para>
346 is a wrapper script that opens a <application>Python</application>
347 aware GUI editor. For this script to run, you must have installed
348 <application>Tk</application> before Python so that the Tkinter
349 Python module is built
350 </para>
351 <indexterm zone="python3 idle3">
352 <primary sortas="b-idle3">idle3</primary>
353 </indexterm>
354 </listitem>
355 </varlistentry>
356
357 <varlistentry id="pydoc3">
358 <term><command>pydoc3</command></term>
359 <listitem>
360 <para>
361 is the <application>Python</application> documentation
362 tool
363 </para>
364 <indexterm zone="python3 pydoc3">
365 <primary sortas="b-pydoc3">pydo3c</primary>
366 </indexterm>
367 </listitem>
368 </varlistentry>
369
370 <varlistentry id="python3-prog">
371 <term><command>python3</command></term>
372 <listitem>
373 <para>
374 is an interpreted, interactive, object-oriented programming
375 language
376 </para>
377 <indexterm zone="python3 python3-prog">
378 <primary sortas="b-python3">python3</primary>
379 </indexterm>
380 </listitem>
381 </varlistentry>
382
383 <varlistentry id="python-ver">
384 <term><command>python&python3-majorver;</command></term>
385 <listitem>
386 <para>
387 is a version-specific name for the <command>python</command>
388 program
389 </para>
390 <indexterm zone="python3 python-ver">
391 <primary sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
392 </indexterm>
393 </listitem>
394 </varlistentry>
395 <!--
396 <varlistentry id="pyvenv">
397 <term><command>pyvenv</command></term>
398 <listitem>
399 <para>
400 creates virtual <application>Python</application> environments in
401 one or more target directories.
402 </para>
403 <indexterm zone="python3 pyvenv">
404 <primary
405 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
406 </indexterm>
407 </listitem>
408 </varlistentry>
409 -->
410 </variablelist>
411
412 </sect2>
413
414</sect1>
Note: See TracBrowser for help on using the repository browser.