source: general/prog/python2.xml@ b9c353b

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 b9c353b was b9c353b, checked in by Ken Moffat <ken@…>, 2 years ago

Typo fixes from rhubarbpieguy.

  • Property mode set to 100644
File size: 12.1 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://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 <date>$Date$</date>
24 </sect1info>
25
26 <title>Python-&python2-version;</title>
27
28 <indexterm zone="python2">
29 <primary sortas="a-Python2">Python2</primary>
30 </indexterm>
31
32 <sect2 role="package">
33 <title>Introduction to Python 2</title>
34
35 <para>
36 The <application>Python 2</application> package contains the
37 <application>Python</application> development environment. It is useful
38 for object-oriented programming, writing scripts, prototyping large
39 programs or developing entire applications. This version is for backward
40 compatibility with other dependent packages.
41 </para>
42
43 <note>
44 <para>
45 Python2 has been deprecated by the upstream developers.
46 Support for Python2 was discontinued on January 1st, 2020.
47 </para>
48
49 <para>
50 BLFS is attempting to use Python3 as much as possible, but some
51 packages have not been updated to support Python3.
52 </para>
53 </note>
54
55 &lfs111_checked;
56
57 <bridgehead renderas="sect3">Package Information</bridgehead>
58 <itemizedlist spacing="compact">
59 <listitem>
60 <para>
61 Download (HTTP): <ulink url="&python2-download-http;"/>
62 </para>
63 </listitem>
64 <listitem>
65 <para>
66 Download (FTP): <ulink url="&python2-download-ftp;"/>
67 </para>
68 </listitem>
69 <listitem>
70 <para>
71 Download MD5 sum: &python2-md5sum;
72 </para>
73 </listitem>
74 <listitem>
75 <para>
76 Download size: &python2-size;
77 </para>
78 </listitem>
79 <listitem>
80 <para>
81 Estimated disk space required: &python2-buildsize;
82 </para>
83 </listitem>
84 <listitem>
85 <para>
86 Estimated build time: &python2-time;
87 </para>
88 </listitem>
89 </itemizedlist>
90
91 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
92
93 <itemizedlist spacing="compact">
94 <listitem>
95 <para>
96 Required patch:
97 <ulink url="&patch-root;/Python-&python2-version;-security_fixes-1.patch"/>
98 </para>
99 </listitem>
100 <listitem>
101 <para>
102 Optional HTML Documentation: <ulink url="&python2htmldoc-download-http;"/>
103 </para>
104 </listitem>
105 </itemizedlist>
106
107
108 <bridgehead renderas="sect3">Python 2 Dependencies</bridgehead>
109
110 <bridgehead renderas="sect4">Recommended</bridgehead>
111 <para role="recommended">
112 <xref linkend="sqlite"/> (For an additional modules)
113 </para>
114
115 <bridgehead renderas="sect4">Optional</bridgehead>
116 <para role="optional">
117 <xref linkend="bluez"/> and
118 <xref linkend="valgrind"/>
119 </para>
120
121 <bridgehead renderas="sect4">Optional (For more additional modules)</bridgehead>
122 <para role="optional">
123 <xref linkend="libnsl"/> and
124 <xref linkend="tk"/>
125 </para>
126
127 <para condition="html" role="usernotes">
128 User Notes: <ulink url="&blfs-wiki;/Python"/>
129 </para>
130 </sect2>
131
132 <sect2 role="installation">
133 <title>Installation of Python 2</title>
134<!--
135 <caution>
136 <para>
137 After installing this package or
138 updating <application>pip2</application> with the command
139 <command>pip2 install - -upgrade pip</command>, it will remove
140 <application>pip3</application> installed in LFS. To reset
141 <application>pip</application> and <application>pip3</application>,
142 run, as the <systemitem class="username">root</systemitem> user:
143 </para>
144
145<screen role="nodump"><userinput>python3 -m pip install - -force pip</userinput></screen>
146 </caution>
147-->
148 <para>
149 First, disable the installation of a script that overwrites a more
150 recent script:
151 </para>
152
153<screen><userinput>sed -i '/2to3/d' ./setup.py</userinput></screen>
154
155 <para>
156 Install <application>Python 2</application> by running the following
157 commands:
158 </para>
159
160<screen><userinput>patch -Np1 -i ../Python-&python2-version;-security_fixes-1.patch &amp;&amp;
161./configure --prefix=/usr \
162 --enable-shared \
163 --with-system-expat \
164 --with-system-ffi \
165 --enable-unicode=ucs4 &amp;&amp;
166make</userinput></screen>
167
168 <para>
169 If you invoke the tests, they will run through twice.
170 To test the results, issue: <command>make -k test</command>.
171 <!-- https://bugs.python.org/issue46811 -->
172 Several tests are known to fail, including
173 <literal>test_ftplib</literal>,
174 <literal>test_ssl</literal>,
175 <literal>test_urllib2_localnet</literal>,
176 <literal>test_xml_etree</literal>, and
177 <literal>test_minidom</literal>. These failures are due to
178 OpenSSL-3 and Expat-2.4.6.
179 </para>
180
181 <para>
182 Now, as the <systemitem class="username">root</systemitem> user:
183 </para>
184
185<screen role="root"><userinput>make altinstall &amp;&amp;
186ln -s python2.7 /usr/bin/python2 &amp;&amp;
187ln -s python2.7-config /usr/bin/python2-config &amp;&amp;
188chmod -v 755 /usr/lib/libpython&python2-majorver;.so.1.0</userinput></screen>
189
190 <para>
191 Since <application>Python 2</application> is in maintenance mode, and
192 <application>Python 3</application> is recommended by upstream for
193 development, you probably do not need to install the documentation.
194 However, if you still want to install documentation for both
195 <application>Python</application> versions, be sure to define the
196 <envar>PYTHONDOCS</envar>
197 variable for the version you want to use, each time you need to consult
198 the documentation. If you have downloaded the preformatted documentation
199 from <ulink url="http://docs.python.org/download.html"/>, install it
200 as the <systemitem class="username">root</systemitem> user:
201 </para>
202
203<screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python2-version; &amp;&amp;
204
205tar --strip-components=1 \
206 --no-same-owner \
207 --directory /usr/share/doc/python-&python2-version; \
208 -xvf ../python-&python2-version;-docs-html.tar.bz2 &amp;&amp;
209
210find /usr/share/doc/python-&python2-version; -type d -exec chmod 0755 {} \; &amp;&amp;
211find /usr/share/doc/python-&python2-version; -type f -exec chmod 0644 {} \;</userinput></screen>
212 </sect2>
213
214 <sect2 role="commands">
215 <title>Command Explanations</title>
216
217 <para>
218 <parameter>--with-system-expat</parameter>: This switch enables linking
219 against system version of <application>Expat</application>.
220 </para>
221
222 <para>
223 <parameter>--with-system-ffi</parameter>: This switch enables linking
224 against system version of <application>libffi</application>.
225 </para>
226
227 <para>
228 <parameter>--enable-unicode=ucs4</parameter>: This switch enables
229 32-bit Unicode support in <application>Python</application>.
230 </para>
231
232 <para>
233 <option>--with-ensurepip=yes</option> : This switch enables building
234 <command>pip</command> and <command>setuptools</command> packaging programs.
235 <command>setuptools</command> is needed for building some Python modules.
236 This switch is not recommended because this version of Python is being phased out.
237 </para>
238
239 <para>
240 <option>--with-dbmliborder=bdb:gdbm:ndbm</option>: Use this switch
241 if you want to build <application>Python</application> DBM Module
242 against <application>Berkeley DB</application> instead of
243 <application>GDBM</application>.
244 </para>
245
246 <para>
247 <command>make altinstall</command>: This make target omits some default
248 symbolic links that may interfere with Python 3.
249 </para>
250
251 <para>
252 <command>chmod ...</command>: Fix permissions for libraries to be
253 consistent with other libraries.
254 </para>
255
256 </sect2>
257
258 <sect2 role="configuration">
259 <title>Configuring Python 2</title>
260
261 <para>
262 In order for <command>python</command> to find the installed
263 documentation, you must add the following environment variable to
264 individual user's or the system's profile:
265 </para>
266
267<screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-&python2-version;</userinput></screen>
268
269 </sect2>
270
271 <sect2 role="content">
272 <title>Contents</title>
273
274 <segmentedlist>
275 <segtitle>Installed Programs</segtitle>
276 <segtitle>Installed Library</segtitle>
277 <segtitle>Installed Directories</segtitle>
278
279 <seglistitem>
280 <seg>
281 pydoc,
282 python2 (symlink),
283 python2-config (symlink),
284 python&python2-majorver;,
285 python&python2-majorver;-config,
286 smtpd.py, and
287 idle
288 </seg>
289 <seg>
290 libpython&python2-majorver;.so
291 </seg>
292 <seg>
293 /usr/{include,lib}/python&python2-majorver; and
294 /usr/share/doc/python-&python2-version;
295 </seg>
296 </seglistitem>
297 </segmentedlist>
298
299 <variablelist>
300 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
301 <?dbfo list-presentation="list"?>
302 <?dbhtml list-presentation="table"?>
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>python2</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.