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">
8 <sect1 id="ch-system-Python" role="wrap">
9 <?dbhtml filename="Python.html"?>
11 <sect1info condition="script">
12 <productname>Python</productname>
13 <productnumber>&python-version;</productnumber>
14 <address>&python-url;</address>
17 <title>Python-&python-version;</title>
19 <indexterm zone="ch-system-Python">
20 <primary sortas="a-python">python</primary>
23 <sect2 role="package">
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>
31 <segtitle>&buildtime;</segtitle>
32 <segtitle>&diskspace;</segtitle>
35 <seg>&python-ch6-sbu;</seg>
36 <seg>&python-ch6-du;</seg>
42 <sect2 role="installation">
43 <title>Installation of Python 3</title>
45 <para>Prepare Python for compilation:</para>
47 <screen><userinput remap="configure">./configure --prefix=/usr \
51 --with-ensurepip=yes</userinput></screen>
54 <title>The meaning of the configure options:</title>
57 <term><parameter>--with-system-expat</parameter></term>
59 <para>This switch enables linking against system version of
60 <application>Expat</application>.</para>
65 <term><parameter>--with-system-ffi</parameter></term>
67 <para>This switch enables linking against system version of
68 <application>libffi</application>.</para>
73 <term><parameter>--with-ensurepip=yes</parameter></term>
75 <para>This switch enables building <command>pip</command> and
76 <command>setuptools</command> packaging programs.</para>
82 <para>Compile the package:</para>
84 <screen><userinput remap="make">make</userinput></screen>
86 <para>The test suite requires TK and and X Windows session and cannot
87 be run until Python 3 is reinstalled in BLFS.</para>
89 <para>Install the package:</para>
91 <screen><userinput remap="install">make install
92 chmod -v 755 /usr/lib/libpython&python-minor;m.so
93 chmod -v 755 /usr/lib/libpython3.so
94 ln -sfv pip3.7 /usr/bin/pip3</userinput></screen>
97 <title>The meaning of the install commands:</title>
98 <!-- ====== Change 7m if Python minor version changes ======= -->
100 <term><command>chmod -v 755 /usr/lib/libpython3.{7m.,}so</command></term>
102 <para>Fix permissions for libraries to be consistent with other
109 <para>If desired, install the preformatted documentation:</para>
111 <screen><userinput remap="install">install -v -dm755 /usr/share/doc/python-&python-version;/html
113 tar --strip-components=1 \
115 --no-same-permissions \
116 -C /usr/share/doc/python-&python-version;/html \
117 -xvf ../python-&python-version;-docs-html.tar.bz2</userinput></screen>
120 <title>The meaning of the documentation install commands:</title>
123 <term><option>--no-same-owner</option> and --no-same-permissions</term>
125 <para>Ensure the installed files have the correct ownership and
126 permissions. Without these options, using <application>tar</application>
127 will install the package files with the upstream creator's values.
136 <sect2 id="contents-python" role="content">
137 <title>Contents of Python 3</title>
140 <segtitle>Installed Programs</segtitle>
141 <segtitle>Installed Library</segtitle>
142 <segtitle>Installed Directories</segtitle>
146 2to3, idle3, pip3, pydoc3, python3, python3-config, and pyvenv
149 libpython&python-minor;m.so and libpython3.so
152 /usr/include/python&python-minor;m, /usr/lib/python3 and
153 /usr/share/doc/python-&python-version;
159 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
160 <?dbfo list-presentation="list"?>
161 <?dbhtml list-presentation="table"?>
163 <varlistentry id="python-2to3">
164 <term><command>2to3</command></term>
167 is a <application>Python</application> program that reads
168 <application>Python 2.x</application> source code and applies a
169 series of fixes to transform it into valid
170 <application>Python 3.x</application> code.
172 <indexterm zone="ch-system-Python">
173 <primary sortas="b-2to3">2to3</primary>
178 <varlistentry id="idle3">
179 <term><command>idle3</command></term>
182 is a wrapper script that opens a <application>Python</application>
183 aware GUI editor. For this script to run, you must have installed
184 <application>Tk</application> before Python so that the Tkinter
185 Python module is built.
187 <indexterm zone="ch-system-Python">
188 <primary sortas="b-idle3">idle3</primary>
193 <varlistentry id="pip3">
194 <term><command>pip3</command></term>
197 The package installer for Python. You can use pip to install
198 packages from Python Package Index and other indexes.
200 <indexterm zone="ch-system-Python">
201 <primary sortas="b-pip3">pip3</primary>
206 <varlistentry id="pydoc3">
207 <term><command>pydoc3</command></term>
210 is the <application>Python</application> documentation tool.
212 <indexterm zone="ch-system-Python">
213 <primary sortas="b-pydoc3">pydoc3</primary>
218 <varlistentry id="python3">
219 <term><command>python3</command></term>
222 is an interpreted, interactive, object-oriented programming
225 <indexterm zone="ch-system-Python">
226 <primary sortas="b-python3">python3</primary>
231 <varlistentry id="pyvenv">
232 <term><command>pyvenv</command></term>
235 creates virtual <application>Python</application> environments in
236 one or more target directories.
238 <indexterm zone="ch-system-Python">
239 <primary sortas="b-pyvenv">pyvenv</primary>