source: general/prog/python2.xml@ d4ef6ae

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 d4ef6ae was cac7f93, checked in by Pierre Labastie <pieere@…>, 5 years ago

Add some "nodep" role to alternative dependencies. Mostly does not change
the rendered book, but allows to simplify the dependency chain for jhalfs

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22169 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 12.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 python2-download-http
8 "https://www.python.org/ftp/python/&python2-version;/Python-&python2-version;.tar.xz">
9 <!ENTITY python2-download-ftp " ">
10 <!ENTITY python2-md5sum "30157d85a2c0479c09ea2cbe61f2aaf5">
11 <!ENTITY python2-size "12 MB">
12 <!ENTITY python2-buildsize "131 MB (add 15 MB for tests)">
13 <!ENTITY python2-time "0.7 SBU (Using parallelism=4; add 6.6 SBU for tests)">
14
15 <!ENTITY python2htmldoc-download-http
16 "https://docs.python.org/ftp/python/doc/&python2-version;/python-&python2-version;-docs-html.tar.bz2">
17]>
18
19<sect1 id="python2" xreflabel="Python-&python2-version;">
20 <?dbhtml filename="python2.html" ?>
21
22 <sect1info>
23 <othername>$LastChangedBy$</othername>
24 <date>$Date$</date>
25 </sect1info>
26
27 <title>Python-&python2-version;</title>
28
29 <indexterm zone="python2">
30 <primary sortas="a-Python2">Python2</primary>
31 </indexterm>
32
33 <sect2 role="package">
34 <title>Introduction to Python 2</title>
35
36 <para>
37 The <application>Python 2</application> package contains the
38 <application>Python</application> development environment. It is useful
39 for object-oriented programming, writing scripts, prototyping large
40 programs or developing entire applications. This version is for backward
41 compatibility with other dependent packages.
42 </para>
43
44 <note>
45 <para>
46 Python2 has been deprecated by the upstream developers.
47 Support for Python2 will be discontinued on January
48 1st, 2020.
49 </para>
50
51 <para>
52 BLFS is attempting to use Python3 as much as possible, but some
53 packages have not been updated to support Python3.
54 </para>
55 </note>
56
57
58 &lfs90_checked;
59
60 <bridgehead renderas="sect3">Package Information</bridgehead>
61 <itemizedlist spacing="compact">
62 <listitem>
63 <para>
64 Download (HTTP): <ulink url="&python2-download-http;"/>
65 </para>
66 </listitem>
67 <listitem>
68 <para>
69 Download (FTP): <ulink url="&python2-download-ftp;"/>
70 </para>
71 </listitem>
72 <listitem>
73 <para>
74 Download MD5 sum: &python2-md5sum;
75 </para>
76 </listitem>
77 <listitem>
78 <para>
79 Download size: &python2-size;
80 </para>
81 </listitem>
82 <listitem>
83 <para>
84 Estimated disk space required: &python2-buildsize;
85 </para>
86 </listitem>
87 <listitem>
88 <para>
89 Estimated build time: &python2-time;
90 </para>
91 </listitem>
92 </itemizedlist>
93
94 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
95
96 <itemizedlist spacing="compact">
97 <title>Optional HTML Documentation</title>
98 <listitem>
99 <para>
100 Download (HTTP): <ulink url="&python2htmldoc-download-http;"/>
101 </para>
102 </listitem>
103 </itemizedlist>
104
105 <bridgehead renderas="sect3">Python 2 Dependencies</bridgehead>
106<!--
107 <bridgehead renderas="sect4">Recommended</bridgehead>
108 <para role="recommended">
109 <xref linkend="libffi"/>
110 </para>
111-->
112 <bridgehead renderas="sect4">Optional</bridgehead>
113 <para role="optional">
114 <xref linkend="bluez"/> and
115 <xref linkend="valgrind"/>
116 </para>
117
118 <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
119 <para role="optional">
120 <xref linkend="sqlite"/> and
121 <xref linkend="tk"/>
122 </para>
123
124 <para condition="html" role="usernotes">
125 User Notes: <ulink url="&blfs-wiki;/Python"/>
126 </para>
127 </sect2>
128
129 <sect2 role="installation">
130 <title>Installation of Python 2</title>
131
132 <caution>
133 <para>
134 If updating <application>pip2</application> with the command
135 <command>pip2 install --upgrade pip</command>, it will remove
136 <application>pip3</application> and the symlink
137 <application>pip</application> installed in LFS. To restore
138 <application>pip</application> and <application>pip3</application>,
139 run, as the <systemitem class="username">root</systemitem> user:
140 </para>
141
142<screen role="nodump"><userinput>python3 -m pip install --force pip</userinput></screen>
143 </caution>
144
145 <para>
146 Install <application>Python 2</application> by running the following
147 commands:
148 </para>
149
150<screen><userinput>./configure --prefix=/usr \
151 --enable-shared \
152 --with-system-expat \
153 --with-system-ffi \
154 --with-ensurepip=yes \
155 --enable-unicode=ucs4 &amp;&amp;
156make</userinput></screen>
157
158 <para>
159 To test the results, issue: <command>make -k test</command>.
160 Three tests fail for unknown reasons.
161 </para>
162
163 <para>
164 Now, as the <systemitem class="username">root</systemitem> user:
165 </para>
166
167<screen role="root"><userinput>make install &amp;&amp;
168chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
169
170 <para>
171 Since <application>Python 2</application> is in maintenance mode, and
172 <application>Python 3</application> is recommended by upstream for
173 development, you probably do not need to install the documentation.
174 However, if you still want to install documentation for both
175 <application>Python</application> versions, be sure to define the
176 <envar>PYTHONDOCS</envar>
177 variable for the version you want to use, each time you need to consult
178 the documentation. If you have downloaded the preformatted documentation
179 from <ulink url="http://docs.python.org/download.html"/>, install it
180 as the <systemitem class="username">root</systemitem> user:
181 </para>
182
183<screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python2-version; &amp;&amp;
184
185tar --strip-components=1 \
186 --no-same-owner \
187 --directory /usr/share/doc/python-&python2-version; \
188 -xvf ../python-&python2-version;-docs-html.tar.bz2 &amp;&amp;
189
190find /usr/share/doc/python-&python2-version; -type d -exec chmod 0755 {} \; &amp;&amp;
191find /usr/share/doc/python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
192 </sect2>
193
194 <sect2 role="commands">
195 <title>Command Explanations</title>
196
197 <para>
198 <parameter>--with-system-expat</parameter>: This switch enables linking
199 against system version of <application>Expat</application>.
200 </para>
201
202 <para>
203 <parameter>--with-system-ffi</parameter>: This switch enables linking
204 against system version of <application>libffi</application>.
205 </para>
206
207 <para>
208 <parameter>--with-ensurepip=yes</parameter> : This switch enables building
209 <command>pip</command> and <command>setuptools</command> packaging programs.
210 <command>setuptools</command> is needed for building some Python modules.
211 </para>
212
213 <para>
214 <parameter>--enable-unicode=ucs4</parameter>: This switch enables
215 32bit Unicode support in <application>Python</application>.
216 </para>
217
218 <para>
219 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
220 if you want to build <application>Python</application> DBM Module
221 against <application>Berkeley DB</application> instead of
222 <application>GDBM</application>.
223 </para>
224
225 <para>
226 <command>chmod ...</command>: Fix permissions for libraries to be
227 consistent with other libraries.
228 </para>
229
230 </sect2>
231
232 <sect2 role="configuration">
233 <title>Configuring Python 2</title>
234
235 <para>
236 In order for <command>python</command> to find the installed
237 documentation, you must add the following environment variable to
238 individual user's or the system's profile:
239 </para>
240
241<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-&python2-version;</userinput></screen>
242
243 </sect2>
244
245 <sect2 role="content">
246 <title>Contents</title>
247
248 <segmentedlist>
249 <segtitle>Installed Programs</segtitle>
250 <segtitle>Installed Library</segtitle>
251 <segtitle>Installed Directories</segtitle>
252
253 <seglistitem>
254 <seg>
255 2to3, pip2, pydoc, python (symlink), python-config (symlink),
256 python2 (symlink), python2-config (symlink),
257 python&python2-majorver;, python&python2-majorver;-config,
258 smtpd.py, and idle
259 </seg>
260 <seg>
261 libpython&python2-majorver;.so
262 </seg>
263 <seg>
264 /usr/{include,lib}/python&python2-majorver; and
265 /usr/share/doc/python-&python2-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="python2-2to3">
276 <term><command>2to3</command></term>
277 <listitem>
278 <para>
279 is a <application>Python</application> program that reads
280 <application>Python 2.x</application> source code and applies a
281 series of fixes to transform it into valid
282 <application>Python 3.x</application> code.
283 </para>
284 <indexterm zone="python2 python2-2to3">
285 <primary sortas="b-2to3">2to3</primary>
286 </indexterm>
287 </listitem>
288 </varlistentry>
289
290 <varlistentry id="pip2">
291 <term><command>pip2</command></term>
292 <listitem>
293 <para>
294 is the package manager for <application>Python 2.x</application>.
295 It is used to automate management of
296 <application>Python 2.x</application> modules.
297 </para>
298 <indexterm zone="python2 pip2">
299 <primary sortas="b-pip2">pip2</primary>
300 </indexterm>
301 </listitem>
302 </varlistentry>
303
304 <varlistentry id="idle">
305 <term><command>idle</command></term>
306 <listitem>
307 <para>
308 is a wrapper script that opens a <application>Python</application>
309 aware GUI editor. For this script to run, you must have installed
310 <application>Tk</application> before Python so that the Tkinter
311 Python module is built.
312 </para>
313 <indexterm zone="python2 idle">
314 <primary sortas="b-idle">idle</primary>
315 </indexterm>
316 </listitem>
317 </varlistentry>
318
319 <varlistentry id="pydoc2">
320 <term><command>pydoc</command></term>
321 <listitem>
322 <para>
323 is the <application>Python</application> documentation tool.
324 </para>
325 <indexterm zone="python2 pydoc2">
326 <primary sortas="b-pydoc2">pydoc</primary>
327 </indexterm>
328 </listitem>
329 </varlistentry>
330
331 <varlistentry id="python">
332 <term><command>python</command></term>
333 <listitem>
334 <para>
335 is an interpreted, interactive, object-oriented programming
336 language.
337 </para>
338 <indexterm zone="python2 python">
339 <primary sortas="b-python2">python</primary>
340 </indexterm>
341 </listitem>
342 </varlistentry>
343
344 <varlistentry id="python2-ver">
345 <term><command>python&python2-majorver;</command></term>
346 <listitem>
347 <para>
348 is a version-specific name for the <command>python</command>
349 program.
350 </para>
351 <indexterm zone="python2 python2-ver">
352 <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
353 </indexterm>
354 </listitem>
355 </varlistentry>
356
357 <varlistentry id="smtpd.py">
358 <term><command>smtpd.py</command></term>
359 <listitem>
360 <para>
361 is an SMTP proxy implemented in <application>Python</application>.
362 </para>
363 <indexterm zone="python2 smtpd.py">
364 <primary sortas="b-smtpd.py">smtpd.py</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.