source: general/prog/python3.xml@ 97bd764

12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 97bd764 was 95a526a5, checked in by Bruce Dubbs <bdubbs@…>, 15 months ago

Update to Python-3.11.3.

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