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 | "http://www.python.org/ftp/python/&python3-version;/Python-&python3-version;.tar.xz">
|
---|
9 | <!ENTITY python3-download-ftp " ">
|
---|
10 | <!ENTITY python3-md5sum "187564726f2c1473d301c586acc24847">
|
---|
11 | <!ENTITY python3-size "8.6 MB">
|
---|
12 | <!ENTITY python3-buildsize "200 MB (30 MB for the test suite)">
|
---|
13 | <!ENTITY python3-time "1.0 SBU (additional 3.0 SBU to run the test suite)">
|
---|
14 | <!ENTITY python3htmldoc-download-http
|
---|
15 | "http://docs.python.org/ftp/python/doc/&python3-version;/python-&python3-version;-docs-html.tar.bz2">
|
---|
16 | <!ENTITY python3htmldoc-md5sum "c970e7bcbc3268a3dbc2de5c15b5a3d3">
|
---|
17 | <!ENTITY python3htmldoc-size "4.2 MB">
|
---|
18 | ]>
|
---|
19 |
|
---|
20 | <sect1 id="python3" xreflabel="Python-&python3-version;">
|
---|
21 | <?dbhtml filename="python3.html" ?>
|
---|
22 |
|
---|
23 | <sect1info>
|
---|
24 | <othername>$LastChangedBy$</othername>
|
---|
25 | <date>$Date$</date>
|
---|
26 | </sect1info>
|
---|
27 |
|
---|
28 | <title>Python-&python3-version;</title>
|
---|
29 |
|
---|
30 | <indexterm zone="python3">
|
---|
31 | <primary sortas="a-Python3">Python</primary>
|
---|
32 | </indexterm>
|
---|
33 |
|
---|
34 | <sect2 role="package">
|
---|
35 | <title>Introduction to Python</title>
|
---|
36 |
|
---|
37 | <para>
|
---|
38 | The <application>Python</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 | &lfs71_checked;
|
---|
45 |
|
---|
46 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
47 | <itemizedlist spacing="compact">
|
---|
48 | <listitem>
|
---|
49 | <para>
|
---|
50 | Download (HTTP): <ulink url="&python3-download-http;"/>
|
---|
51 | </para>
|
---|
52 | </listitem>
|
---|
53 | <listitem>
|
---|
54 | <para>
|
---|
55 | Download (FTP): <ulink url="&python3-download-ftp;"/>
|
---|
56 | </para>
|
---|
57 | </listitem>
|
---|
58 | <listitem>
|
---|
59 | <para>
|
---|
60 | Download MD5 sum: &python3-md5sum;
|
---|
61 | </para>
|
---|
62 | </listitem>
|
---|
63 | <listitem>
|
---|
64 | <para>
|
---|
65 | Download size: &python3-size;
|
---|
66 | </para>
|
---|
67 | </listitem>
|
---|
68 | <listitem>
|
---|
69 | <para>
|
---|
70 | Estimated disk space required: &python3-buildsize;
|
---|
71 | </para>
|
---|
72 | </listitem>
|
---|
73 | <listitem>
|
---|
74 | <para>
|
---|
75 | Estimated build time: &python3-time;
|
---|
76 | </para>
|
---|
77 | </listitem>
|
---|
78 | </itemizedlist>
|
---|
79 |
|
---|
80 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
81 | <itemizedlist spacing="compact">
|
---|
82 | <title>Optional HTML Documentation</title>
|
---|
83 | <listitem>
|
---|
84 | <para>
|
---|
85 | Download (HTTP): <ulink url="&python3htmldoc-download-http;"/>
|
---|
86 | </para>
|
---|
87 | </listitem>
|
---|
88 | <listitem>
|
---|
89 | <para>
|
---|
90 | Download MD5 sum: &python3htmldoc-md5sum;
|
---|
91 | </para>
|
---|
92 | </listitem>
|
---|
93 | <listitem>
|
---|
94 | <para>
|
---|
95 | Download size: &python3htmldoc-size;
|
---|
96 | </para>
|
---|
97 | </listitem>
|
---|
98 | </itemizedlist>
|
---|
99 |
|
---|
100 | <bridgehead renderas="sect3">Python Dependencies</bridgehead>
|
---|
101 |
|
---|
102 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
103 | <para role="recommended">
|
---|
104 | <xref linkend="expat"/> and
|
---|
105 | <xref linkend="libffi"/>
|
---|
106 | </para>
|
---|
107 |
|
---|
108 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
109 | <para role="optional">
|
---|
110 | <xref linkend="bluez"/>
|
---|
111 | </para>
|
---|
112 |
|
---|
113 | <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
|
---|
114 | <para role="optional">
|
---|
115 | <xref linkend="db"/>
|
---|
116 | <xref linkend="openssl"/>,
|
---|
117 | <xref linkend="sqlite"/> and
|
---|
118 | <xref linkend="tk"/>
|
---|
119 | </para>
|
---|
120 |
|
---|
121 | <para condition="html" role="usernotes">User Notes:
|
---|
122 | <ulink url="&blfs-wiki;/Python3"/>
|
---|
123 | </para>
|
---|
124 | </sect2>
|
---|
125 |
|
---|
126 | <sect2 role="installation">
|
---|
127 | <title>Installation of Python</title>
|
---|
128 |
|
---|
129 | <para>
|
---|
130 | Install <application>Python</application> by running the following
|
---|
131 | commands:
|
---|
132 | </para>
|
---|
133 |
|
---|
134 | <screen><userinput>sed -i "s/ndbm_libs = \[\]/ndbm_libs = ['gdbm', 'gdbm_compat']/" setup.py &&
|
---|
135 | ./configure --prefix=/usr \
|
---|
136 | --enable-shared \
|
---|
137 | --with-wide-unicode \
|
---|
138 | --with-system-expat \
|
---|
139 | --with-system-ffi &&
|
---|
140 | make</userinput></screen>
|
---|
141 |
|
---|
142 | <para>
|
---|
143 | To test the results, issue: <command>make test</command>. Note that
|
---|
144 | if you have an existing <application>Python</application> installation
|
---|
145 | which includes the <application>PyXML</application> module, the tests could
|
---|
146 | produce a segmentation fault.
|
---|
147 | </para>
|
---|
148 |
|
---|
149 | <para>
|
---|
150 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
151 | </para>
|
---|
152 |
|
---|
153 | <screen role="root"><userinput>make install &&
|
---|
154 | chmod -v 755 /usr/lib/libpython&python3-majorver;mu.so &&
|
---|
155 | chmod -v 755 /usr/lib/libpython3.so</userinput></screen>
|
---|
156 |
|
---|
157 | <para>
|
---|
158 | There is no documentation installed using the instructions above.
|
---|
159 | See the <filename>Doc/README.txt</filename> file in the source
|
---|
160 | distribution for instructions on how to create the html. Alternatively,
|
---|
161 | you can download preformatted documentation from
|
---|
162 | <ulink url="http://docs.python.org/download.html"/>.
|
---|
163 | </para>
|
---|
164 |
|
---|
165 | <para>
|
---|
166 | In order to use the <command>help ('name_string')</command> feature
|
---|
167 | of the <command>python</command> interpreter with some statements and
|
---|
168 | keywords, you must download (or create) the optional HTML documentation
|
---|
169 | and install it. If you downloaded the HTML docs, issue the following
|
---|
170 | commands as the <systemitem class="username">root</systemitem> user:
|
---|
171 | </para>
|
---|
172 |
|
---|
173 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/Python-&python3-version;/html &&
|
---|
174 | tar --strip-components=1 \
|
---|
175 | --no-same-owner \
|
---|
176 | --no-same-permissions \
|
---|
177 | -C /usr/share/doc/Python-&python3-version;/html \
|
---|
178 | -xvf ../python-&python3-version;-docs-html.tar.bz2</userinput></screen>
|
---|
179 |
|
---|
180 | </sect2>
|
---|
181 |
|
---|
182 | <sect2 role="commands">
|
---|
183 | <title>Command Explanations</title>
|
---|
184 |
|
---|
185 | <para>
|
---|
186 | <command>sed -i "s/ndbm_libs = ..." setup.py</command>: This command
|
---|
187 | is used to fix a build problem with the <application>GDBM</application>
|
---|
188 | library.
|
---|
189 | </para>
|
---|
190 |
|
---|
191 | <para>
|
---|
192 | <option>--with-sytem-expat</option>: This switch enables linking against
|
---|
193 | system version of <application>Expat</application>. Remove if you have
|
---|
194 | not installed recommended dependency <xref linkend="expat"/>.
|
---|
195 | </para>
|
---|
196 |
|
---|
197 | <para>
|
---|
198 | <option>--with-system-ffi</option>: This switch enables linking against
|
---|
199 | system version of <application>libffi</application>. Remove if you have
|
---|
200 | not installed recommended dependency <xref linkend="libffi"/>.
|
---|
201 | </para>
|
---|
202 |
|
---|
203 | <para>
|
---|
204 | <command>chmod ...</command>: Fix permissions for shared libraries to be
|
---|
205 | consistent with other libraries.
|
---|
206 | </para>
|
---|
207 |
|
---|
208 | </sect2>
|
---|
209 |
|
---|
210 | <sect2 role="configuration">
|
---|
211 | <title>Configuring Python</title>
|
---|
212 |
|
---|
213 | <para>
|
---|
214 | In order for <command>python</command> to find the installed
|
---|
215 | documentation, you must add the following environment variable to
|
---|
216 | individual user's or the system's profile:
|
---|
217 | </para>
|
---|
218 |
|
---|
219 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/Python-&python3-version;/html</userinput></screen>
|
---|
220 |
|
---|
221 | </sect2>
|
---|
222 |
|
---|
223 | <sect2 role="content">
|
---|
224 | <title>Contents</title>
|
---|
225 |
|
---|
226 | <segmentedlist>
|
---|
227 | <segtitle>Installed Programs</segtitle>
|
---|
228 | <segtitle>Installed Libraries</segtitle>
|
---|
229 | <segtitle>Installed Directories</segtitle>
|
---|
230 |
|
---|
231 | <seglistitem>
|
---|
232 | <seg>
|
---|
233 | 2to3 (symbolic link to 2to3-&python3-majorver;),
|
---|
234 | 2to3-&python3-majorver;,
|
---|
235 |
|
---|
236 | pydoc3 (symbolic link to pydoc&python3-majorver;),
|
---|
237 | pydoc&python3-majorver;,
|
---|
238 |
|
---|
239 | python3 (hard link to python&python3-majorver;mu),
|
---|
240 | python&python3-majorver; (hard link to python&python3-majorver;mu),
|
---|
241 | python&python3-majorver;mu,
|
---|
242 |
|
---|
243 | python3-config (symbolic link to python&python3-majorver;-config),
|
---|
244 | python&python3-majorver;-config (symbolic link to python3-config),
|
---|
245 | python&python3-majorver;mu-config,
|
---|
246 |
|
---|
247 | and optionally if Tk is installed,
|
---|
248 | idle3 (symbolic link to idle&python3-majorver;),
|
---|
249 | idle&python3-majorver;
|
---|
250 | </seg>
|
---|
251 | <seg>
|
---|
252 | libpython&python3-majorver;mu.so, libpython3.so and numerous
|
---|
253 | modules installed in /usr/lib/python&python3-majorver;
|
---|
254 | </seg>
|
---|
255 | <seg>
|
---|
256 | /usr/include/python&python3-majorver;mu,
|
---|
257 | /usr/lib/python&python3-majorver;, and
|
---|
258 | /usr/share/doc/python-&python3-version;
|
---|
259 | </seg>
|
---|
260 | </seglistitem>
|
---|
261 | </segmentedlist>
|
---|
262 |
|
---|
263 | <variablelist>
|
---|
264 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
265 | <?dbfo list-presentation="list"?>
|
---|
266 | <?dbhtml list-presentation="table"?>
|
---|
267 |
|
---|
268 | <varlistentry id="idle3">
|
---|
269 | <term><command>idle3</command></term>
|
---|
270 | <listitem>
|
---|
271 | <para>
|
---|
272 | is a wrapper script that opens a
|
---|
273 | <application>Python</application> aware GUI editor.
|
---|
274 | </para>
|
---|
275 | <indexterm zone="python3 idle3">
|
---|
276 | <primary sortas="b-idle3">idle3</primary>
|
---|
277 | </indexterm>
|
---|
278 | </listitem>
|
---|
279 | </varlistentry>
|
---|
280 |
|
---|
281 | <varlistentry id="pydoc3">
|
---|
282 | <term><command>pydoc3</command></term>
|
---|
283 | <listitem>
|
---|
284 | <para>
|
---|
285 | is the <application>Python</application> documentation
|
---|
286 | tool.
|
---|
287 | </para>
|
---|
288 | <indexterm zone="python3 pydoc3">
|
---|
289 | <primary sortas="b-pydoc3">pydo3c</primary>
|
---|
290 | </indexterm>
|
---|
291 | </listitem>
|
---|
292 | </varlistentry>
|
---|
293 |
|
---|
294 | <varlistentry id="python3-prog">
|
---|
295 | <term><command>python3</command></term>
|
---|
296 | <listitem>
|
---|
297 | <para>
|
---|
298 | is an interpreted, interactive, object-oriented programming
|
---|
299 | language.
|
---|
300 | </para>
|
---|
301 | <indexterm zone="python3 python3-prog">
|
---|
302 | <primary sortas="b-python3">python3</primary>
|
---|
303 | </indexterm>
|
---|
304 | </listitem>
|
---|
305 | </varlistentry>
|
---|
306 |
|
---|
307 | <varlistentry id="python-ver">
|
---|
308 | <term><command>python&python3-majorver;</command></term>
|
---|
309 | <listitem>
|
---|
310 | <para>
|
---|
311 | is a version-specific name for the <command>python</command>
|
---|
312 | program.
|
---|
313 | </para>
|
---|
314 | <indexterm zone="python3 python-ver">
|
---|
315 | <primary
|
---|
316 | sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
|
---|
317 | </indexterm>
|
---|
318 | </listitem>
|
---|
319 | </varlistentry>
|
---|
320 |
|
---|
321 | </variablelist>
|
---|
322 |
|
---|
323 | </sect2>
|
---|
324 |
|
---|
325 | </sect1>
|
---|