source: general/prog/python3.xml@ 45ab6c7

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 45ab6c7 was 45ab6c7, checked in by Xi Ruoyao <xry111@…>, 3 years ago

more SVN prop clean up

Remove "$LastChanged$" everywhere, and also some unused $Date$

  • Property mode set to 100644
File size: 11.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 "f0dc9000312abeb16de4eccce9a870ab">
11 <!ENTITY python3-size "18 MB">
12 <!ENTITY python3-buildsize "379 MB (add 36 MB for tests)">
13 <!ENTITY python3-time "0.5 SBU (using parallelism=4; add 1.7 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 &lfs101_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"/> and
106 <xref linkend="tk"/>
107 </para>
108
109 <para condition="html" role="usernotes">User Notes:
110 <ulink url="&blfs-wiki;/Python3"/>
111 </para>
112 </sect2>
113
114 <sect2 role="installation">
115 <title>Installation of Python 3</title>
116
117 <para>
118 Fix a header file, which is needed for some use cases:
119 </para>
120
121<screen><userinput>sed 's|cpython/||' -i Include/cpython/pystate.h</userinput></screen>
122
123 <para>
124 Install <application>Python 3</application> by running the following
125 commands:
126 </para>
127
128<screen><userinput>CXX="/usr/bin/g++" \
129./configure --prefix=/usr \
130 --enable-shared \
131 --with-system-expat \
132 --with-system-ffi \
133 --with-ensurepip=yes &amp;&amp;
134make</userinput></screen>
135
136 <para>
137 To test the result, issue <command>make test</command>.
138 Some tests may need Internet connection.
139 </para>
140
141 <para>
142 Now, as the <systemitem class="username">root</systemitem> user:
143 </para>
144
145<screen role="root"><userinput>make install</userinput></screen>
146
147 </sect2>
148
149 <sect2 role="commands">
150 <title>Command Explanations</title>
151
152 <para>
153 <command> CXX="/usr/bin/g++" ./configure ...</command>: Avoid an annoying
154 message during configuration.
155 </para>
156
157 <para>
158 <parameter>--with-system-expat</parameter>: This switch enables linking
159 against the system version of <application>Expat</application>.
160 </para>
161
162 <para>
163 <parameter>--with-system-ffi</parameter>: This switch enables linking
164 against system version of <application>libffi</application>.
165 </para>
166
167 <para>
168 <parameter>--with-ensurepip=yes</parameter> : This switch enables building
169 <command>pip</command> and <command>setuptools</command> packaging programs.
170 <command>setuptools</command> is needed for building some Python modules.
171 </para>
172
173 <para>
174 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
175 if you want to build <application>Python</application> DBM Module
176 against <application>Berkeley DB</application> instead of
177 <application>GDBM</application>.
178 </para>
179
180 <para>
181 <option>--enable-optimization</option>: Use this switch
182 if you want to enable <emphasis>expensive</emphasis> optimizations (i.e.
183 Profile Guided Optimizations). This adds around 20 SBU, but can
184 <emphasis>slightly</emphasis> speed up some uses, such as using
185 <application>Sphinx</application> for creating documentation, or use of
186 <application>Python3</application> scripts.
187 </para>
188
189 <para>
190 <option>--with-lto</option>: This optional switch enables thick Link
191 Time Optimization. Unusually, it creates a much larger <filename
192 class="libraryfile">/usr/lib/python&python3-majorver;/config-&python3-majorver;-&lt;arch&gt;-linux-gnu/libpython&python3-majorver;.a</filename>
193 with a small increase in the time to compile
194 <application>Python</application>. Run-time results do not appear to show
195 any benefit from doing this.
196 </para>
197 <!--
198 <para>
199 <command>ln -sfv ...</command>: When upgrading to Python-3.8, it was
200 discovered that the symlink to pip3 is sometimes not created. Create
201 the symlink so that pip3 can be used as described in the book.
202 </para>
203 -->
204
205 </sect2>
206
207 <sect2 role="configuration">
208 <title>Configuring Python 3</title>
209
210 <para>
211 In order for <command>python3</command> to find the installed
212 documentation, create the following version independent symlink:
213 </para>
214
215<screen role="root"><userinput>ln -svfn python-&python3-version; /usr/share/doc/python-3</userinput></screen>
216
217 <para>
218 and add the following environment variable to the individual user's or
219 system's profile:
220 </para>
221
222<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-3/html</userinput></screen>
223
224 </sect2>
225
226 <sect2 role="content">
227 <title>Contents</title>
228
229 <segmentedlist>
230 <segtitle>Installed Programs</segtitle>
231 <segtitle>Installed Libraries</segtitle>
232 <segtitle>Installed Directories</segtitle>
233
234 <seglistitem>
235 <seg>
236 2to3 (symlink) and
237 2to3-&python3-majorver;,
238
239 easy_install-&python3-majorver;,
240
241 idle3 (symlink) and
242 idle&python3-majorver;,
243
244 pip3 (symlink) and
245 pip&python3-majorver;,
246
247 pydoc3 and
248 pydoc&python3-majorver;,
249
250 python3 (symlink);
251 python&python3-majorver;, and
252
253 python3 (symlink), and
254 python&python3-majorver;
255
256 python3-config (symlink) and
257 python&python3-majorver;-config
258 </seg>
259 <seg>
260 libpython&python3-majorver;.so and libpython3.so
261 </seg>
262 <seg>
263 /usr/include/python&python3-majorver;,
264 /usr/lib/python&python3-majorver;, and
265 /usr/share/doc/python-&python3-version;
266 </seg>
267 </seglistitem>
268 </segmentedlist>
269
270 <variablelist>
271 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
272 <?dbfo list-presentation="list"?>
273 <?dbhtml list-presentation="table"?>
274 <!--
275 <varlistentry id="2to3">
276 <term><command>2to3</command></term>
277 <listitem>
278 <para>
279 is designed to assist in the transition between python2 and python3
280 by automatically converting code to be Python3 compatible.
281 </para>
282 <indexterm zone="python3 2to3">
283 <primary sortas="b-2to3">2to3</primary>
284 </indexterm>
285 </listitem>
286 </varlistentry>
287 Put here for easy use when removing Python2 -->
288 <varlistentry id="easy_install">
289 <term><command>easy_install</command></term>
290 <listitem>
291 <para>
292 is a frontend to pip3 to make it easier to configure python modules
293 through the PIP package manager
294 </para>
295 <indexterm zone="python3 easy_install">
296 <primary sortas="python3 easy_install">easy_install</primary>
297 </indexterm>
298 </listitem>
299 </varlistentry>
300
301 <varlistentry id="idle3">
302 <term><command>idle3</command></term>
303 <listitem>
304 <para>
305 is a wrapper script that opens a <application>Python</application>
306 aware GUI editor. For this script to run, you must have installed
307 <application>Tk</application> before Python so that the Tkinter
308 Python module is built
309 </para>
310 <indexterm zone="python3 idle3">
311 <primary sortas="b-idle3">idle3</primary>
312 </indexterm>
313 </listitem>
314 </varlistentry>
315
316 <varlistentry id="pydoc3">
317 <term><command>pydoc3</command></term>
318 <listitem>
319 <para>
320 is the <application>Python</application> documentation
321 tool
322 </para>
323 <indexterm zone="python3 pydoc3">
324 <primary sortas="b-pydoc3">pydo3c</primary>
325 </indexterm>
326 </listitem>
327 </varlistentry>
328
329 <varlistentry id="python3-prog">
330 <term><command>python3</command></term>
331 <listitem>
332 <para>
333 is an interpreted, interactive, object-oriented programming
334 language
335 </para>
336 <indexterm zone="python3 python3-prog">
337 <primary sortas="b-python3">python3</primary>
338 </indexterm>
339 </listitem>
340 </varlistentry>
341
342 <varlistentry id="python-ver">
343 <term><command>python&python3-majorver;</command></term>
344 <listitem>
345 <para>
346 is a version-specific name for the <command>python</command>
347 program
348 </para>
349 <indexterm zone="python3 python-ver">
350 <primary sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
351 </indexterm>
352 </listitem>
353 </varlistentry>
354 <!--
355 <varlistentry id="pyvenv">
356 <term><command>pyvenv</command></term>
357 <listitem>
358 <para>
359 creates virtual <application>Python</application> environments in
360 one or more target directories.
361 </para>
362 <indexterm zone="python3 pyvenv">
363 <primary
364 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
365 </indexterm>
366 </listitem>
367 </varlistentry>
368 -->
369 </variablelist>
370
371 </sect2>
372
373</sect1>
Note: See TracBrowser for help on using the repository browser.