python.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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 \
  40. --enable-unicode=ucs4</userinput></screen>
  41. <variablelist>
  42. <title>The meaning of the configure options:</title>
  43. <varlistentry>
  44. <term><parameter>--with-system-expat</parameter></term>
  45. <listitem>
  46. <para>This switch enables linking against system version of
  47. <application>Expat</application>.</para>
  48. </listitem>
  49. </varlistentry>
  50. <varlistentry>
  51. <term><parameter>--with-system-ffi</parameter></term>
  52. <listitem>
  53. <para>This switch enables linking against system version of
  54. <application>libffi</application>.</para>
  55. </listitem>
  56. </varlistentry>
  57. <varlistentry>
  58. <term><parameter>--with-ensurepip=yes</parameter></term>
  59. <listitem>
  60. <para>This switch enables building <command>pip</command> and
  61. <command>setuptools</command> packaging programs.</para>
  62. </listitem>
  63. </varlistentry>
  64. <varlistentry>
  65. <term><parameter>--enable-unicode=ucs4</parameter></term>
  66. <listitem>
  67. <para>This switch enables 32bit Unicode support in
  68. <application>Python</application>.</para>
  69. </listitem>
  70. </varlistentry>
  71. </variablelist>
  72. <para>Compile the package:</para>
  73. <screen><userinput remap="make">make</userinput></screen>
  74. <para>The test suite requires TK and and X Windows session and cannot
  75. be run until Python 3 is reinstalled in BLFS.</para>
  76. <para>Install the package:</para>
  77. <screen><userinput remap="install">make install
  78. chmod -v 755 /usr/lib/libpython3.6m.so
  79. chmod -v 755 /usr/lib/libpython3.so</userinput></screen>
  80. <variablelist>
  81. <title>The meaning of the install commands:</title>
  82. <varlistentry>
  83. <term><command>chmod -v 755 /usr/lib/libpython3.{6m.,}so</command></term>
  84. <listitem>
  85. <para>Fix permissions for libraries to be consistent with other
  86. libraries.</para>
  87. </listitem>
  88. </varlistentry>
  89. </variablelist>
  90. <para>If desired, install the preformatted documentation:</para>
  91. <screen><userinput remap="install">install -v -dm755 /usr/share/doc/python-&python-version;/html
  92. tar --strip-components=1 \
  93. --no-same-owner \
  94. --no-same-permissions \
  95. -C /usr/share/doc/python-&python-version;/html \
  96. -xvf ../python-&python-version;-docs-html.tar.bz2</userinput></screen>
  97. <variablelist>
  98. <title>The meaning of the documentation install commands:</title>
  99. <varlistentry>
  100. <term><option>--no-same-owner</option> and --no-same-permissions</term>
  101. <listitem>
  102. <para>Ensure the installed files have the correct ownership and
  103. prermissions. Without these options, using <application>tar</application>
  104. will install the package files with the upstream creator's values.
  105. </para>
  106. </listitem>
  107. </varlistentry>
  108. </variablelist>
  109. </sect2>
  110. <sect2 id="contents-python" role="content">
  111. <title>Contents of Python 3</title>
  112. <segmentedlist>
  113. <segtitle>Installed Programs</segtitle>
  114. <segtitle>Installed Library</segtitle>
  115. <segtitle>Installed Directories</segtitle>
  116. <seglistitem>
  117. <seg>
  118. 2to3, idle3, pydoc3, python3, python3-config, pyvenv
  119. </seg>
  120. <seg>
  121. libpython3.6m.so and libpython3.so
  122. </seg>
  123. <seg>
  124. /usr/include/python3.6m, /usr/lib/python3 and
  125. /usr/share/doc/python-&python-version;
  126. </seg>
  127. </seglistitem>
  128. </segmentedlist>
  129. <variablelist>
  130. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  131. <?dbfo list-presentation="list"?>
  132. <?dbhtml list-presentation="table"?>
  133. <varlistentry id="python-2to3">
  134. <term><command>2to3</command></term>
  135. <listitem>
  136. <para>
  137. is a <application>Python</application> program that reads
  138. <application>Python 2.x</application> source code and applies a
  139. series of fixes to transform it into valid
  140. <application>Python 3.x</application> code.
  141. </para>
  142. <indexterm zone="ch-system-Python">
  143. <primary sortas="b-2to3">2to3</primary>
  144. </indexterm>
  145. </listitem>
  146. </varlistentry>
  147. <varlistentry id="idle3">
  148. <term><command>idle3</command></term>
  149. <listitem>
  150. <para>
  151. is a wrapper script that opens a <application>Python</application>
  152. aware GUI editor. For this script to run, you must have installed
  153. <application>Tk</application> before Python so that the Tkinter
  154. Python module is built.
  155. </para>
  156. <indexterm zone="ch-system-Python">
  157. <primary sortas="b-idle3">idle3</primary>
  158. </indexterm>
  159. </listitem>
  160. </varlistentry>
  161. <varlistentry id="pydoc3">
  162. <term><command>pydoc3</command></term>
  163. <listitem>
  164. <para>
  165. is the <application>Python</application> documentation tool.
  166. </para>
  167. <indexterm zone="ch-system-Python">
  168. <primary sortas="b-pydoc3">pydoc3</primary>
  169. </indexterm>
  170. </listitem>
  171. </varlistentry>
  172. <varlistentry id="python3">
  173. <term><command>python3</command></term>
  174. <listitem>
  175. <para>
  176. is an interpreted, interactive, object-oriented programming
  177. language.
  178. </para>
  179. <indexterm zone="ch-system-Python">
  180. <primary sortas="b-python3">python3</primary>
  181. </indexterm>
  182. </listitem>
  183. </varlistentry>
  184. <varlistentry id="pyvenv">
  185. <term><command>pyvenv</command></term>
  186. <listitem>
  187. <para>
  188. creates virtual <application>Python</application> environments in
  189. one or more target directories.
  190. </para>
  191. <indexterm zone="ch-system-Python">
  192. <primary sortas="b-pyvenv">pyvenv</primary>
  193. </indexterm>
  194. </listitem>
  195. </varlistentry>
  196. </variablelist>
  197. </sect2>
  198. </sect1>