source: general/prog/python3.xml@ f2ff0e4

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 9.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 f2ff0e4 was f2ff0e4, checked in by Douglas R. Reno <renodr@…>, 5 years ago

python3: Fix the installation instructions by bumping the major version of Python3 to 3.8
python3: Add required dependency on lsb-tools (which doesn't work, but I've poked DJ since he's technically upstream)
python3: Update the command explanation for --enable-optimization to use the correct location now that it's python3.8
python3: Add commented short description for 2to3 for when python2 is eventually phased out
python3: Add new program 'easy_install' and add description.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22274 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 "dbac8df9d8b9edc678d0f4cacdb7dbb0">
11 <!ENTITY python3-size "17 MB">
12 <!ENTITY python3-buildsize "193 MB (add 38 MB for tests)">
13 <!ENTITY python3-time "0.5 SBU (add 1.9 SBU for tests)">
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 &lfs90_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">Required</bridgehead>
89 <para role="required">
90 <!-- This is called upon during the installation of setuptools. -->
91 <!-- I've emailed DJ since there is a problem with this, and he is
92 technically upstream. Since it uses a Python module that isn't
93 recompiled yet, lsb_release fails to run.-->
94 <xref linkend="lsb-tools"/>
95 </para>
96
97 <bridgehead renderas="sect4">Optional</bridgehead>
98 <para role="optional">
99 <xref linkend="bluez"/>,
100 <xref linkend="gdb"/> (required for some tests),
101 <xref linkend="valgrind"/>, and
102 <ulink url="http://www.bytereef.org/mpdecimal">libmpcdec</ulink>
103 </para>
104
105 <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
106 <para role="optional">
107 <xref linkend="db"/>,
108 <xref linkend="sqlite"/>, and
109 <xref linkend="tk"/>
110 </para>
111
112 <para condition="html" role="usernotes">User Notes:
113 <ulink url="&blfs-wiki;/Python3"/>
114 </para>
115 </sect2>
116
117 <sect2 role="installation">
118 <title>Installation of Python 3</title>
119
120 <para>
121 Install <application>Python 3</application> by running the following
122 commands:
123 </para>
124
125<screen><userinput>CXX="/usr/bin/g++" \
126./configure --prefix=/usr \
127 --enable-shared \
128 --with-system-expat \
129 --with-system-ffi \
130 --with-ensurepip=yes &amp;&amp;
131make</userinput></screen>
132
133 <para>
134 The test suite must be run separately, using an X terminal (see below).
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 &amp;&amp;
142chmod -v 755 /usr/lib/libpython&python3-majorver;.so &amp;&amp;
143chmod -v 755 /usr/lib/libpython3.so</userinput></screen>
144
145 <para>
146 The test suite must be run separately from the build, either before or
147 after the package is built and installed. Do not run
148 <command>make install</command> after running the test suite. To build
149 and install the package, you need to start with a fresh or clean source
150 tree. For the tests, you also need a clean source code, so either start by
151 removing the source code directory and starting over, by uncompressing
152 the source tarball or by running <command>make clean</command>. Then
153 configure again, adding <quote>--with-pydebug</quote> to the
154 <command>configure</command> switches above, run <command>make</command>,
155 then <command>make test</command>. Remember that tests must be executed
156 using an X terminal.
157 The test SBU highly depends on the speed of the internet connection.
158 The test_sqlite test is known to fail.
159 </para>
160
161 </sect2>
162
163 <sect2 role="commands">
164 <title>Command Explanations</title>
165
166 <para>
167 <command> CXX="/usr/bin/g++" ./configure ...</command>: Avoid an annoying
168 message during configuration.
169 </para>
170
171 <para>
172 <parameter>--with-system-expat</parameter>: This switch enables linking
173 against the system version of <application>Expat</application>.
174 </para>
175
176 <para>
177 <parameter>--with-system-ffi</parameter>: This switch enables linking
178 against system version of <application>libffi</application>.
179 </para>
180
181 <para>
182 <parameter>--with-ensurepip=yes</parameter> : This switch enables building
183 <command>pip</command> and <command>setuptools</command> packaging programs.
184 <command>setuptools</command> is needed for building some Python modules.
185 </para>
186
187 <para>
188 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
189 if you want to build <application>Python</application> DBM Module
190 against <application>Berkeley DB</application> instead of
191 <application>GDBM</application>.
192 </para>
193
194 <para>
195 <option>--enable-optimization</option>: Use this switch
196 if you want to enable <emphasis>expensive</emphasis> optimizations (i.e.
197 Profile Guided Optimizations). This adds around 20 SBU, but can
198 <emphasis>slightly</emphasis> speed up some uses, such as using
199 <application>Sphinx</application> for creating documentation, or use of
200 <application>Python3</application> scripts.
201 </para>
202
203 <para>
204 <option>--with-lto</option>: This optional switch enables thick Link
205 Time Optimization. Unusually, it creates a much larger <filename
206 class="libraryfile">/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.a</filename>
207 with a small increase in the time to compile
208 <application>Python</application>. Run-time results do not appear to show
209 any benefit from doing this.
210 </para>
211
212 <para>
213 <command>chmod ...</command>: Fix permissions for shared libraries to be
214 consistent with other libraries.
215 </para>
216
217 </sect2>
218
219 <sect2 role="configuration">
220 <title>Configuring Python 3</title>
221
222 <para>
223 In order for <command>python3</command> to find the installed
224 documentation, create the following version independent symlink:
225 </para>
226
227<screen role="root"><userinput>ln -svfn python-&python3-version; /usr/share/doc/python-3</userinput></screen>
228
229 <para>
230 and add the following environment variable to the individual user's or
231 system's profile:
232 </para>
233
234<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-3/html</userinput></screen>
235
236 </sect2>
237
238 <sect2 role="content">
239 <title>Contents</title>
240
241 <segmentedlist>
242 <segtitle>Installed Programs</segtitle>
243 <segtitle>Installed Libraries</segtitle>
244 <segtitle>Installed Directories</segtitle>
245
246 <seglistitem>
247 <seg>
248 2to3 (symlink) and
249 2to3-&python3-majorver;,
250
251 easy_install (symlink) and
252 easy_install-&python3-majorver;,
253
254 idle3 (symlink) and
255 idle&python3-majorver;,
256
257 pip3 (symlink) and
258 pip&python3-majorver;,
259
260 pydoc3 (symlink) and
261 pydoc&python3-majorver;,
262
263 python3 (symlink);
264 python&python3-majorver;, and
265
266 python3-config (symlink) and
267 python&python3-majorver;-config
268 <!--
269 pyvenv (symlink),
270 pyvenv-&python3-majorver;
271 -->
272 </seg>
273 <seg>
274 libpython&python3-majorver;.so and libpython3.so
275 </seg>
276 <seg>
277 /usr/include/python&python3-majorver;,
278 /usr/lib/python&python3-majorver;, and
279 /usr/share/doc/python-&python3-version;
280 </seg>
281 </seglistitem>
282 </segmentedlist>
283
284 <variablelist>
285 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
286 <?dbfo list-presentation="list"?>
287 <?dbhtml list-presentation="table"?>
288 <!--
289 <varlistentry id="2to3">
290 <term><command>2to3</command></term>
291 <listitem>
292 <para>
293 is designed to assist in the transition between python2 and python3
294 by automatically converting code to be Python3 compatible.
295 </para>
296 <indexterm zone="python3 2to3">
297 <primary sortas="b-2to3">2to3</primary>
298 </indexterm>
299 </listitem>
300 </varlistentry>
301 Put here for easy use when removing Python2 -->
302 <varlistentry id="easy_install">
303 <term><command>easy_install</command></term>
304 <listitem>
305 <para>
306 is a frontend to pip3 to make it easier to configure python modules
307 through the PIP package manager.
308 </para>
309 <indexterm zone="python3 easy_install">
310 <primary sortas="python3 easy_install">easy_install</primary>
311 </indexterm>
312 </listitem>
313 </varlistentry>
314
315 <varlistentry id="idle3">
316 <term><command>idle3</command></term>
317 <listitem>
318 <para>
319 is a wrapper script that opens a <application>Python</application>
320 aware GUI editor. For this script to run, you must have installed
321 <application>Tk</application> before Python so that the Tkinter
322 Python module is built.
323 </para>
324 <indexterm zone="python3 idle3">
325 <primary sortas="b-idle3">idle3</primary>
326 </indexterm>
327 </listitem>
328 </varlistentry>
329
330 <varlistentry id="pydoc3">
331 <term><command>pydoc3</command></term>
332 <listitem>
333 <para>
334 is the <application>Python</application> documentation
335 tool.
336 </para>
337 <indexterm zone="python3 pydoc3">
338 <primary sortas="b-pydoc3">pydo3c</primary>
339 </indexterm>
340 </listitem>
341 </varlistentry>
342
343 <varlistentry id="python3-prog">
344 <term><command>python3</command></term>
345 <listitem>
346 <para>
347 is an interpreted, interactive, object-oriented programming
348 language.
349 </para>
350 <indexterm zone="python3 python3-prog">
351 <primary sortas="b-python3">python3</primary>
352 </indexterm>
353 </listitem>
354 </varlistentry>
355
356 <varlistentry id="python-ver">
357 <term><command>python&python3-majorver;</command></term>
358 <listitem>
359 <para>
360 is a version-specific name for the <command>python</command>
361 program.
362 </para>
363 <indexterm zone="python3 python-ver">
364 <primary
365 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
366 </indexterm>
367 </listitem>
368 </varlistentry>
369 <!--
370 <varlistentry id="pyvenv">
371 <term><command>pyvenv</command></term>
372 <listitem>
373 <para>
374 creates virtual <application>Python</application> environments in
375 one or more target directories.
376 </para>
377 <indexterm zone="python3 pyvenv">
378 <primary
379 sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
380 </indexterm>
381 </listitem>
382 </varlistentry>
383 -->
384 </variablelist>
385
386 </sect2>
387
388</sect1>
Note: See TracBrowser for help on using the repository browser.