source: general/prog/python3.xml@ 9be7202

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules 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 9be7202 was 9be7202, checked in by Igor Živković <igor@…>, 8 years ago

revert last commit as util-linux seems to provide libuuid

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

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