source: chapter08/python.xml@ 44cb6a28

10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 44cb6a28 was 44cb6a28, checked in by Xi Ruoyao <xry111@…>, 3 years ago

ch08/python: fix a hardcoded minor version in command explanation

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@12080 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 7.5 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
8<sect1 id="ch-system-Python" role="wrap">
9 <?dbhtml filename="Python.html"?>
10
11 <sect1info condition="script">
12 <productname>Python</productname>
13 <productnumber>&python-version;</productnumber>
14 <address>&python-url;</address>
15 </sect1info>
16
17 <title>Python-&python-version;</title>
18
19 <indexterm zone="ch-system-Python">
20 <primary sortas="a-Python">Python</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Python 3 package contains the Python development environment. It
27 is useful for object-oriented programming, writing scripts, prototyping
28 large programs, or developing entire applications.</para>
29
30 <segmentedlist>
31 <segtitle>&buildtime;</segtitle>
32 <segtitle>&diskspace;</segtitle>
33
34 <seglistitem>
35 <seg>&python-fin-sbu;</seg>
36 <seg>&python-fin-du;</seg>
37 </seglistitem>
38 </segmentedlist>
39
40 </sect2>
41
42 <sect2 role="installation">
43 <title>Installation of Python 3</title>
44
45 <para>Prepare Python for compilation:</para>
46
47<screen><userinput remap="configure">./configure --prefix=/usr \
48 --enable-shared \
49 --with-system-expat \
50 --with-system-ffi \
51 --with-ensurepip=yes</userinput></screen>
52
53 <variablelist>
54 <title>The meaning of the configure options:</title>
55
56 <varlistentry>
57 <term><parameter>--with-system-expat</parameter></term>
58 <listitem>
59 <para>This switch enables linking against system version of
60 <application>Expat</application>.</para>
61 </listitem>
62 </varlistentry>
63
64 <varlistentry>
65 <term><parameter>--with-system-ffi</parameter></term>
66 <listitem>
67 <para>This switch enables linking against system version of
68 <application>libffi</application>.</para>
69 </listitem>
70 </varlistentry>
71
72 <varlistentry>
73 <term><parameter>--with-ensurepip=yes</parameter></term>
74 <listitem>
75 <para>This switch enables building <command>pip</command> and
76 <command>setuptools</command> packaging programs.</para>
77 </listitem>
78 </varlistentry>
79
80 </variablelist>
81
82 <para>Compile the package:</para>
83
84<screen><userinput remap="make">make</userinput></screen>
85
86 <para>To test the results, issue:</para>
87
88<screen><userinput remap="test">make test</userinput></screen>
89
90 <para>Some tests requiring a network connection or additional packages are
91 skipped. The test named test_unicodedata fails because network
92 configuration is not completed yet. For more comprehensive results,
93 the test can be rerun when Python 3 is reinstalled in BLFS.</para>
94
95 <para>Install the package:</para>
96
97<screen><userinput remap="install">make install
98chmod -v 755 /usr/lib/libpython&python-minor;.so
99chmod -v 755 /usr/lib/libpython3.so
100ln -sfv pip&python-minor; /usr/bin/pip3</userinput></screen>
101
102 <variablelist>
103 <title>The meaning of the install commands:</title>
104<!-- ====== Change 8m if Python minor version changes ======= -->
105 <varlistentry>
106 <term><command>chmod -v 755 /usr/lib/libpython{&python-minor;,3}.so</command></term>
107 <listitem>
108 <para>Fix permissions for libraries to be consistent with other
109 libraries.</para>
110 </listitem>
111 </varlistentry>
112
113 </variablelist>
114
115 <para>If desired, install the preformatted documentation:</para>
116
117<screen><userinput remap="install">install -v -dm755 /usr/share/doc/python-&python-version;/html
118
119tar --strip-components=1 \
120 --no-same-owner \
121 --no-same-permissions \
122 -C /usr/share/doc/python-&python-version;/html \
123 -xvf ../python-&python-version;-docs-html.tar.bz2</userinput></screen>
124
125 <variablelist>
126 <title>The meaning of the documentation install commands:</title>
127
128 <varlistentry>
129 <term><option>--no-same-owner</option> and <option>--no-same-permissions</option></term>
130 <listitem>
131 <para>Ensure the installed files have the correct ownership and
132 permissions. Without these options, using <application>tar</application>
133 will install the package files with the upstream creator's values.
134 </para>
135 </listitem>
136 </varlistentry>
137
138 </variablelist>
139
140 </sect2>
141
142 <sect2 id="contents-python" role="content">
143 <title>Contents of Python 3</title>
144
145 <segmentedlist>
146 <segtitle>Installed Programs</segtitle>
147 <segtitle>Installed Library</segtitle>
148 <segtitle>Installed Directories</segtitle>
149
150 <seglistitem>
151 <seg>
152 2to3, idle3, pip3, pydoc3, python3, and python3-config
153 </seg>
154 <seg>
155 libpython&python-minor;.so and libpython3.so
156 </seg>
157 <seg>
158 /usr/include/python&python-minor;,
159 /usr/lib/python3, and
160 /usr/share/doc/python-&python-version;
161 </seg>
162 </seglistitem>
163 </segmentedlist>
164
165 <variablelist>
166 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
167 <?dbfo list-presentation="list"?>
168 <?dbhtml list-presentation="table"?>
169
170 <varlistentry id="python-2to3">
171 <term><command>2to3</command></term>
172 <listitem>
173 <para>
174 is a <application>Python</application> program that reads
175 <application>Python 2.x</application> source code and applies a
176 series of fixes to transform it into
177 valid <application>Python 3.x</application> code.
178 </para>
179 <indexterm zone="ch-system-Python">
180 <primary sortas="b-2to3">2to3</primary>
181 </indexterm>
182 </listitem>
183 </varlistentry>
184
185 <varlistentry id="idle3">
186 <term><command>idle3</command></term>
187 <listitem>
188 <para>
189 is a wrapper script that opens a <application>Python</application>
190 aware GUI editor. For this script to run, you must have installed
191 <application>Tk</application> before Python so that the Tkinter
192 Python module is built.
193 </para>
194 <indexterm zone="ch-system-Python">
195 <primary sortas="b-idle3">idle3</primary>
196 </indexterm>
197 </listitem>
198 </varlistentry>
199
200 <varlistentry id="pip3">
201 <term><command>pip3</command></term>
202 <listitem>
203 <para>
204 The package installer for Python. You can use pip to install
205 packages from Python Package Index and other indexes.
206 </para>
207 <indexterm zone="ch-system-Python">
208 <primary sortas="b-pip3">pip3</primary>
209 </indexterm>
210 </listitem>
211 </varlistentry>
212
213 <varlistentry id="pydoc3">
214 <term><command>pydoc3</command></term>
215 <listitem>
216 <para>
217 is the <application>Python</application> documentation tool.
218 </para>
219 <indexterm zone="ch-system-Python">
220 <primary sortas="b-pydoc3">pydoc3</primary>
221 </indexterm>
222 </listitem>
223 </varlistentry>
224
225 <varlistentry id="python3">
226 <term><command>python3</command></term>
227 <listitem>
228 <para>
229 is an interpreted, interactive, object-oriented programming
230 language.
231 </para>
232 <indexterm zone="ch-system-Python">
233 <primary sortas="b-python3">python3</primary>
234 </indexterm>
235 </listitem>
236 </varlistentry>
237
238 </variablelist>
239
240 </sect2>
241
242</sect1>
243
Note: See TracBrowser for help on using the repository browser.