source: general/prog/python3.xml@ 8a21a6ae

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 xry111/llvm18 xry111/soup3 xry111/xf86-video-removal
Last change on this file since 8a21a6ae was 8a21a6ae, checked in by Bruce Dubbs <bdubbs@…>, 2 years ago

Package updates.
Update to Python-3.10.4.
Update to Jinja2-3.1.1 (Python module).

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