source: general/prog/python2.xml@ a8c1294

11.3 12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal r11.3
Last change on this file since a8c1294 was f040dc0, checked in by Douglas R. Reno <renodr@…>, 15 months ago

Python2: typo fix

  • Property mode set to 100644
File size: 11.6 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 "fd6cc8ec0a78c44036f825e739f36e5a">
11 <!ENTITY python2-size "12.2 MB">
12 <!ENTITY python2-buildsize "228 MB (add 17 MB for tests)">
13 <!ENTITY python2-time "0.5 SBU (Using parallelism=4; add 5.9 SBU for tests)">
14
15 <!ENTITY python2htmldoc-download-http
16 "https://www.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
23 <title>Python-&python2-version;</title>
24
25 <indexterm zone="python2">
26 <primary sortas="a-Python2">Python2</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Python 2</title>
31
32 <para>
33 The <application>Python 2</application> package contains the
34 <application>Python</application> development environment. It is useful
35 for object-oriented programming, writing scripts, prototyping large
36 programs or developing entire applications. This version is for backward
37 compatibility with other dependent packages.
38 </para>
39
40 <note>
41 <para>
42 Python2 has been deprecated by the upstream developers.
43 Support for Python2 was discontinued on January 1st, 2020.
44 </para>
45
46 <para>
47 BLFS is attempting to use Python3 as much as possible, but some
48 packages have not been updated to support Python3.
49 </para>
50 </note>
51
52 &lfs113_checked;
53
54 <bridgehead renderas="sect3">Package Information</bridgehead>
55 <itemizedlist spacing="compact">
56 <listitem>
57 <para>
58 Download (HTTP): <ulink url="&python2-download-http;"/>
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Download (FTP): <ulink url="&python2-download-ftp;"/>
64 </para>
65 </listitem>
66 <listitem>
67 <para>
68 Download MD5 sum: &python2-md5sum;
69 </para>
70 </listitem>
71 <listitem>
72 <para>
73 Download size: &python2-size;
74 </para>
75 </listitem>
76 <listitem>
77 <para>
78 Estimated disk space required: &python2-buildsize;
79 </para>
80 </listitem>
81 <listitem>
82 <para>
83 Estimated build time: &python2-time;
84 </para>
85 </listitem>
86 </itemizedlist>
87
88 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
89
90 <itemizedlist spacing="compact">
91 <listitem>
92 <para>
93 Required patch:
94 <ulink url="&patch-root;/Python-&python2-version;-security_fixes-1.patch"/>
95 </para>
96 </listitem>
97 <listitem>
98 <para>
99 Optional HTML Documentation: <ulink url="&python2htmldoc-download-http;"/>
100 </para>
101 </listitem>
102 </itemizedlist>
103
104
105 <bridgehead renderas="sect3">Python 2 Dependencies</bridgehead>
106
107 <bridgehead renderas="sect4">Recommended</bridgehead>
108 <para role="recommended">
109 <xref linkend="sqlite"/> (For an additional module)
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 more additional modules)</bridgehead>
119 <para role="optional">
120 <xref linkend="libnsl"/> 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 <para>
133 First, disable the installation of a script that overwrites a more
134 recent script:
135 </para>
136
137<screen><userinput>sed -i '/2to3/d' ./setup.py</userinput></screen>
138
139 <para>
140 Install <application>Python 2</application> by running the following
141 commands:
142 </para>
143
144<screen><userinput>patch -Np1 -i ../Python-&python2-version;-security_fixes-1.patch &amp;&amp;
145./configure --prefix=/usr \
146 --enable-shared \
147 --with-system-expat \
148 --with-system-ffi \
149 --enable-unicode=ucs4 &amp;&amp;
150make</userinput></screen>
151
152 <para>
153 If you invoke the tests, they will run through twice.
154 To test the results, issue: <command>make -k test</command>.
155 <!-- https://bugs.python.org/issue46811 -->
156 Several tests are known to fail, including
157 <literal>test_ftplib</literal>,
158 <literal>test_ssl</literal>,
159 <literal>test_urllib2_localnet</literal>,
160 <literal>test_xml_etree</literal>,
161 <literal>test_xml_etree_c</literal>, and
162 <literal>test_minidom</literal>. These failures are due to
163 OpenSSL-3 and Expat-2.4.6.
164 </para>
165
166 <para>
167 Now, as the <systemitem class="username">root</systemitem> user:
168 </para>
169
170<screen role="root"><userinput>make altinstall &amp;&amp;
171ln -s python2.7 /usr/bin/python2 &amp;&amp;
172ln -s python2.7-config /usr/bin/python2-config &amp;&amp;
173chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
174
175 <para>
176 Since <application>Python 2</application> is in maintenance mode, and
177 <application>Python 3</application> is recommended by upstream for
178 development, you probably do not need to install the documentation.
179 However, if you still want to install documentation for both
180 <application>Python</application> versions, be sure to define the
181 <envar>PYTHONDOCS</envar>
182 variable for the version you want to use, each time you need to consult
183 the documentation. If you have downloaded the preformatted documentation
184 from <ulink url="https://docs.python.org/download.html"/>, install it
185 as the <systemitem class="username">root</systemitem> user:
186 </para>
187
188<screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python2-version; &amp;&amp;
189
190tar --strip-components=1 \
191 --no-same-owner \
192 --directory /usr/share/doc/python-&python2-version; \
193 -xvf ../python-&python2-version;-docs-html.tar.bz2 &amp;&amp;
194
195find /usr/share/doc/python-&python2-version; -type d -exec chmod 0755 {} \; &amp;&amp;
196find /usr/share/doc/python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
197 </sect2>
198
199 <sect2 role="commands">
200 <title>Command Explanations</title>
201
202 <para>
203 <parameter>--with-system-expat</parameter>: This switch enables linking
204 against system version of <application>Expat</application>.
205 </para>
206
207 <para>
208 <parameter>--with-system-ffi</parameter>: This switch enables linking
209 against system version of <application>libffi</application>.
210 </para>
211
212 <para>
213 <parameter>--enable-unicode=ucs4</parameter>: This switch enables
214 32-bit Unicode support in <application>Python</application>.
215 </para>
216
217 <para>
218 <option>--with-ensurepip=yes</option> : This switch enables building
219 <command>pip</command> and <command>setuptools</command> packaging programs.
220 <command>setuptools</command> is needed for building some Python modules.
221 This switch is not recommended because this version of Python is no longer
222 maintained.
223 </para>
224
225 <para>
226 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
227 if you want to build <application>Python</application> DBM Module
228 against <application>Berkeley DB</application> instead of
229 <application>GDBM</application>.
230 </para>
231
232 <para>
233 <command>make altinstall</command>: This make target omits some default
234 symbolic links that may interfere with Python 3.
235 </para>
236
237 <para>
238 <command>chmod ...</command>: Fix permissions for libraries to be
239 consistent with other libraries.
240 </para>
241
242 </sect2>
243
244 <sect2 role="configuration">
245 <title>Configuring Python 2</title>
246
247 <para>
248 In order for <command>python</command> to find the installed
249 documentation, you must add the following environment variable to
250 individual user's or the system's profile:
251 </para>
252
253<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-&python2-version;</userinput></screen>
254
255 </sect2>
256
257 <sect2 role="content">
258 <title>Contents</title>
259
260 <segmentedlist>
261 <segtitle>Installed Programs</segtitle>
262 <segtitle>Installed Library</segtitle>
263 <segtitle>Installed Directories</segtitle>
264
265 <seglistitem>
266 <seg>
267 pydoc,
268 python2 (symlink),
269 python2-config (symlink),
270 python&python2-majorver;,
271 python&python2-majorver;-config,
272 smtpd.py, and
273 idle
274 </seg>
275 <seg>
276 libpython&python2-majorver;.so
277 </seg>
278 <seg>
279 /usr/{include,lib}/python&python2-majorver; and
280 /usr/share/doc/python-&python2-version;
281 </seg>
282 </seglistitem>
283 </segmentedlist>
284
285 <variablelist>
286 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
287 <?dbfo list-presentation="list"?>
288 <?dbhtml list-presentation="table"?>
289
290 <varlistentry id="idle">
291 <term><command>idle</command></term>
292 <listitem>
293 <para>
294 is a wrapper script that opens a <application>Python</application>
295 aware GUI editor. For this script to run, you must have installed
296 <application>Tk</application> before Python so that the Tkinter
297 Python module is built
298 </para>
299 <indexterm zone="python2 idle">
300 <primary sortas="b-idle">idle</primary>
301 </indexterm>
302 </listitem>
303 </varlistentry>
304
305 <varlistentry id="pydoc2">
306 <term><command>pydoc</command></term>
307 <listitem>
308 <para>
309 is the <application>Python</application> documentation tool
310 </para>
311 <indexterm zone="python2 pydoc2">
312 <primary sortas="b-pydoc2">pydoc</primary>
313 </indexterm>
314 </listitem>
315 </varlistentry>
316
317 <varlistentry id="python">
318 <term><command>python2</command></term>
319 <listitem>
320 <para>
321 is an interpreted, interactive, object-oriented programming
322 language
323 </para>
324 <indexterm zone="python2 python">
325 <primary sortas="b-python2">python</primary>
326 </indexterm>
327 </listitem>
328 </varlistentry>
329
330 <varlistentry id="python2-ver">
331 <term><command>python&python2-majorver;</command></term>
332 <listitem>
333 <para>
334 is a version-specific name for the <command>python</command>
335 program
336 </para>
337 <indexterm zone="python2 python2-ver">
338 <primary sortas="b-python&python2-majorver;">python&python2-majorver;</primary>
339 </indexterm>
340 </listitem>
341 </varlistentry>
342
343 <varlistentry id="smtpd.py">
344 <term><command>smtpd.py</command></term>
345 <listitem>
346 <para>
347 is an SMTP proxy implemented in <application>Python</application>
348 </para>
349 <indexterm zone="python2 smtpd.py">
350 <primary sortas="b-smtpd.py">smtpd.py</primary>
351 </indexterm>
352 </listitem>
353 </varlistentry>
354
355 </variablelist>
356
357 </sect2>
358
359</sect1>
Note: See TracBrowser for help on using the repository browser.