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 "6cafc183b4106476dd73d5738d7f616a">
|
---|
11 | <!ENTITY python3-size "14 MB">
|
---|
12 | <!ENTITY python3-buildsize "266 MB (additional 38 MB for the docs and 37 MB for the tests)">
|
---|
13 | <!ENTITY python3-time "1.1 SBU (additional 0.1 SBU for the tests)">
|
---|
14 |
|
---|
15 | <!ENTITY python3htmldoc-download-http
|
---|
16 | "http://docs.python.org/3/archives/python-&python3-version;-docs-html.tar.bz2">
|
---|
17 | <!ENTITY python3htmldoc-md5sum "e5662b53413b0dd05d1ee1a075956370">
|
---|
18 | <!ENTITY python3htmldoc-size "5.2 MB">
|
---|
19 | ]>
|
---|
20 |
|
---|
21 | <sect1 id="python3" xreflabel="Python-&python3-version;">
|
---|
22 | <?dbhtml filename="python3.html" ?>
|
---|
23 |
|
---|
24 | <sect1info>
|
---|
25 | <othername>$LastChangedBy$</othername>
|
---|
26 | <date>$Date$</date>
|
---|
27 | </sect1info>
|
---|
28 |
|
---|
29 | <title>Python-&python3-version;</title>
|
---|
30 |
|
---|
31 | <indexterm zone="python3">
|
---|
32 | <primary sortas="a-Python3">Python3</primary>
|
---|
33 | </indexterm>
|
---|
34 |
|
---|
35 | <sect2 role="package">
|
---|
36 | <title>Introduction to Python 3</title>
|
---|
37 |
|
---|
38 | <para>
|
---|
39 | The <application>Python 3</application> package contains the
|
---|
40 | <application>Python</application> development environment.
|
---|
41 | This is useful for object-oriented programming, writing scripts,
|
---|
42 | prototyping large programs or developing entire applications.
|
---|
43 | </para>
|
---|
44 |
|
---|
45 | &lfs75_checked;
|
---|
46 |
|
---|
47 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
48 | <itemizedlist spacing="compact">
|
---|
49 | <listitem>
|
---|
50 | <para>
|
---|
51 | Download (HTTP): <ulink url="&python3-download-http;"/>
|
---|
52 | </para>
|
---|
53 | </listitem>
|
---|
54 | <listitem>
|
---|
55 | <para>
|
---|
56 | Download (FTP): <ulink url="&python3-download-ftp;"/>
|
---|
57 | </para>
|
---|
58 | </listitem>
|
---|
59 | <listitem>
|
---|
60 | <para>
|
---|
61 | Download MD5 sum: &python3-md5sum;
|
---|
62 | </para>
|
---|
63 | </listitem>
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Download size: &python3-size;
|
---|
67 | </para>
|
---|
68 | </listitem>
|
---|
69 | <listitem>
|
---|
70 | <para>
|
---|
71 | Estimated disk space required: &python3-buildsize;
|
---|
72 | </para>
|
---|
73 | </listitem>
|
---|
74 | <listitem>
|
---|
75 | <para>
|
---|
76 | Estimated build time: &python3-time;
|
---|
77 | </para>
|
---|
78 | </listitem>
|
---|
79 | </itemizedlist>
|
---|
80 |
|
---|
81 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
82 | <itemizedlist spacing="compact">
|
---|
83 | <title>Optional HTML Documentation</title>
|
---|
84 | <listitem>
|
---|
85 | <para>
|
---|
86 | Download (HTTP): <ulink url="&python3htmldoc-download-http;"/>
|
---|
87 | </para>
|
---|
88 | </listitem>
|
---|
89 | <listitem>
|
---|
90 | <para>
|
---|
91 | Download MD5 sum: &python3htmldoc-md5sum;
|
---|
92 | </para>
|
---|
93 | </listitem>
|
---|
94 | <listitem>
|
---|
95 | <para>
|
---|
96 | Download size: &python3htmldoc-size;
|
---|
97 | </para>
|
---|
98 | </listitem>
|
---|
99 | </itemizedlist>
|
---|
100 |
|
---|
101 | <bridgehead renderas="sect3">Python 3 Dependencies</bridgehead>
|
---|
102 |
|
---|
103 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
104 | <para role="recommended">
|
---|
105 | <xref linkend="libffi"/>
|
---|
106 | </para>
|
---|
107 |
|
---|
108 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
109 | <para role="optional">
|
---|
110 | <xref linkend="bluez"/>,
|
---|
111 | <xref linkend="gdb"/> (required for some tests), and
|
---|
112 | <xref linkend="valgrind"/>
|
---|
113 | </para>
|
---|
114 |
|
---|
115 | <bridgehead renderas="sect4">Optional (For Additional Modules)</bridgehead>
|
---|
116 | <para role="optional">
|
---|
117 | <xref linkend="db"/>,
|
---|
118 | <xref linkend="openssl"/>,
|
---|
119 | <xref linkend="sqlite"/> and
|
---|
120 | <xref linkend="tk"/>
|
---|
121 | </para>
|
---|
122 |
|
---|
123 | <para condition="html" role="usernotes">User Notes:
|
---|
124 | <ulink url="&blfs-wiki;/Python3"/>
|
---|
125 | </para>
|
---|
126 | </sect2>
|
---|
127 |
|
---|
128 | <sect2 role="installation">
|
---|
129 | <title>Installation of Python 3</title>
|
---|
130 |
|
---|
131 | <para>
|
---|
132 | Install <application>Python 3</application> by running the following
|
---|
133 | commands:
|
---|
134 | </para>
|
---|
135 |
|
---|
136 | <screen><userinput>CXX="/usr/bin/g++" \
|
---|
137 | ./configure --prefix=/usr \
|
---|
138 | --enable-shared \
|
---|
139 | --with-system-expat \
|
---|
140 | --with-system-ffi \
|
---|
141 | --without-ensurepip &&
|
---|
142 | make</userinput></screen>
|
---|
143 |
|
---|
144 | <para>
|
---|
145 | The test suite must be run separately, using an X terminal (see below).
|
---|
146 | </para>
|
---|
147 |
|
---|
148 | <para>
|
---|
149 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
150 | </para>
|
---|
151 |
|
---|
152 | <screen role="root"><userinput>make install &&
|
---|
153 | chmod -v 755 /usr/lib/libpython&python3-majorver;m.so &&
|
---|
154 | chmod -v 755 /usr/lib/libpython3.so</userinput></screen>
|
---|
155 |
|
---|
156 | <para>
|
---|
157 | If you have downloaded the preformatted documentation from
|
---|
158 | <ulink url="http://docs.python.org/download.html"/>, install it
|
---|
159 | as the <systemitem class="username">root</systemitem> user:
|
---|
160 | </para>
|
---|
161 |
|
---|
162 | <screen role="root"><userinput>install -v -dm755 /usr/share/doc/python-&python3-version;/html &&
|
---|
163 | tar --strip-components=1 \
|
---|
164 | --no-same-owner \
|
---|
165 | --no-same-permissions \
|
---|
166 | -C /usr/share/doc/python-&python3-version;/html \
|
---|
167 | -xvf ../python-&python3-version;-docs-html.tar.bz2</userinput></screen>
|
---|
168 |
|
---|
169 | <para>
|
---|
170 | The test suite must be run separately from the build, either before or
|
---|
171 | after the package is built and installed. Do not run
|
---|
172 | <command>make install</command>, after running the test suite. To build
|
---|
173 | and install the package, you need to start with a fresh or clean source
|
---|
174 | tree. For the test, you also need a clean source code, so either start by
|
---|
175 | removing the source code directory and starting over, by uncompressing
|
---|
176 | the source tarball or by running <command>make clean</command>. Then
|
---|
177 | configure again, adding <quote>--with-pydebug</quote> to the
|
---|
178 | <command>configure</command> switches above, run <command>make</command>,
|
---|
179 | then <command>make test</command>. Remember that some tests fail, if not
|
---|
180 | run in an X terminal.
|
---|
181 | </para>
|
---|
182 |
|
---|
183 | </sect2>
|
---|
184 |
|
---|
185 | <sect2 role="commands">
|
---|
186 | <title>Command Explanations</title>
|
---|
187 |
|
---|
188 | <para>
|
---|
189 | <command> CXX="/usr/bin/g++" ./configure ...</command>: Avoid an annoying
|
---|
190 | message during configuration.
|
---|
191 | </para>
|
---|
192 |
|
---|
193 | <para>
|
---|
194 | <option>--with-system-expat</option>: This switch enables linking against
|
---|
195 | system version of <application>Expat</application>.
|
---|
196 | </para>
|
---|
197 |
|
---|
198 | <para>
|
---|
199 | <option>--with-system-ffi</option>: This switch enables linking against
|
---|
200 | system version of <application>libffi</application>. Remove if you have
|
---|
201 | not installed recommended dependency <xref linkend="libffi"/>.
|
---|
202 | </para>
|
---|
203 |
|
---|
204 | <para>
|
---|
205 | <parameter>--with-dbmliborder=bdb:gdbm:ndbm</parameter>: Use this switch
|
---|
206 | if you want to build <application>Python</application> DBM Module
|
---|
207 | against <application>Berkeley DB</application> instead of
|
---|
208 | <application>GDBM</application>.
|
---|
209 | </para>
|
---|
210 |
|
---|
211 | <para>
|
---|
212 | <parameter>--without-ensurepip</parameter>: This switch disables building
|
---|
213 | <command>pip</command> and <command>setuptools</command>
|
---|
214 | packaging programs.
|
---|
215 | </para>
|
---|
216 |
|
---|
217 | <para>
|
---|
218 | <command>chmod ...</command>: Fix permissions for shared libraries to be
|
---|
219 | consistent with other libraries.
|
---|
220 | </para>
|
---|
221 |
|
---|
222 | </sect2>
|
---|
223 |
|
---|
224 | <sect2 role="configuration">
|
---|
225 | <title>Configuring Python 3</title>
|
---|
226 |
|
---|
227 | <para>
|
---|
228 | In order for <command>python3</command> to find the installed
|
---|
229 | documentation, you must add the following environment variable to
|
---|
230 | individual user's or the system's profile:
|
---|
231 | </para>
|
---|
232 |
|
---|
233 | <screen role="root"><userinput>export PYTHONDOCS=/usr/share/doc/python-&python3-version;/html</userinput></screen>
|
---|
234 |
|
---|
235 | </sect2>
|
---|
236 |
|
---|
237 | <sect2 role="content">
|
---|
238 | <title>Contents</title>
|
---|
239 |
|
---|
240 | <segmentedlist>
|
---|
241 | <segtitle>Installed Programs</segtitle>
|
---|
242 | <segtitle>Installed Libraries</segtitle>
|
---|
243 | <segtitle>Installed Directories</segtitle>
|
---|
244 |
|
---|
245 | <seglistitem>
|
---|
246 | <seg>
|
---|
247 | 2to3 (symlink),
|
---|
248 | 2to3-&python3-majorver;,
|
---|
249 |
|
---|
250 | pydoc3 (symlink),
|
---|
251 | pydoc&python3-majorver;,
|
---|
252 |
|
---|
253 | python3 (symlink);
|
---|
254 | python&python3-majorver; and python&python3-majorver;m (hardlinked);
|
---|
255 |
|
---|
256 | python3-config (symlink),
|
---|
257 | python&python3-majorver;-config (symlink),
|
---|
258 | python&python3-majorver;m-config,
|
---|
259 |
|
---|
260 | pyvenv (symlink),
|
---|
261 | pyvenv&python3-majorver;,
|
---|
262 |
|
---|
263 | and optionally, if Tk is installed,
|
---|
264 | idle3 (symlink) and
|
---|
265 | idle&python3-majorver;
|
---|
266 | </seg>
|
---|
267 | <seg>
|
---|
268 | libpython&python3-majorver;m.so and libpython3.so;
|
---|
269 | several under /usr/lib/python3.3/lib-dynload/
|
---|
270 | </seg>
|
---|
271 | <seg>
|
---|
272 | /usr/include/python&python3-majorver;m,
|
---|
273 | /usr/lib/python&python3-majorver;, and
|
---|
274 | /usr/share/doc/python-&python3-version;
|
---|
275 | </seg>
|
---|
276 | </seglistitem>
|
---|
277 | </segmentedlist>
|
---|
278 |
|
---|
279 | <variablelist>
|
---|
280 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
281 | <?dbfo list-presentation="list"?>
|
---|
282 | <?dbhtml list-presentation="table"?>
|
---|
283 |
|
---|
284 | <varlistentry id="idle3">
|
---|
285 | <term><command>idle3</command></term>
|
---|
286 | <listitem>
|
---|
287 | <para>
|
---|
288 | is a wrapper script that opens a
|
---|
289 | <application>Python</application> aware GUI editor.
|
---|
290 | </para>
|
---|
291 | <indexterm zone="python3 idle3">
|
---|
292 | <primary sortas="b-idle3">idle3</primary>
|
---|
293 | </indexterm>
|
---|
294 | </listitem>
|
---|
295 | </varlistentry>
|
---|
296 |
|
---|
297 | <varlistentry id="pydoc3">
|
---|
298 | <term><command>pydoc3</command></term>
|
---|
299 | <listitem>
|
---|
300 | <para>
|
---|
301 | is the <application>Python</application> documentation
|
---|
302 | tool.
|
---|
303 | </para>
|
---|
304 | <indexterm zone="python3 pydoc3">
|
---|
305 | <primary sortas="b-pydoc3">pydo3c</primary>
|
---|
306 | </indexterm>
|
---|
307 | </listitem>
|
---|
308 | </varlistentry>
|
---|
309 |
|
---|
310 | <varlistentry id="python3-prog">
|
---|
311 | <term><command>python3</command></term>
|
---|
312 | <listitem>
|
---|
313 | <para>
|
---|
314 | is an interpreted, interactive, object-oriented programming
|
---|
315 | language.
|
---|
316 | </para>
|
---|
317 | <indexterm zone="python3 python3-prog">
|
---|
318 | <primary sortas="b-python3">python3</primary>
|
---|
319 | </indexterm>
|
---|
320 | </listitem>
|
---|
321 | </varlistentry>
|
---|
322 |
|
---|
323 | <varlistentry id="python-ver">
|
---|
324 | <term><command>python&python3-majorver;</command></term>
|
---|
325 | <listitem>
|
---|
326 | <para>
|
---|
327 | is a version-specific name for the <command>python</command>
|
---|
328 | program.
|
---|
329 | </para>
|
---|
330 | <indexterm zone="python3 python-ver">
|
---|
331 | <primary
|
---|
332 | sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
|
---|
333 | </indexterm>
|
---|
334 | </listitem>
|
---|
335 | </varlistentry>
|
---|
336 |
|
---|
337 | <varlistentry id="pyvenv">
|
---|
338 | <term><command>pyvenv</command></term>
|
---|
339 | <listitem>
|
---|
340 | <para>
|
---|
341 | creates virtual <application>Python</application> environments in
|
---|
342 | one or more target directories.
|
---|
343 | </para>
|
---|
344 | <indexterm zone="python3 pyvenv">
|
---|
345 | <primary
|
---|
346 | sortas="b-python&python3-majorver;">python&python3-majorver;</primary>
|
---|
347 | </indexterm>
|
---|
348 | </listitem>
|
---|
349 | </varlistentry>
|
---|
350 |
|
---|
351 | </variablelist>
|
---|
352 |
|
---|
353 | </sect2>
|
---|
354 |
|
---|
355 | </sect1>
|
---|