python.xml 7.8 KB

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