python.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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-fin-sbu;</seg>
  28. <seg>&python-fin-du;</seg>
  29. </seglistitem>
  30. </segmentedlist>
  31. </sect2>
  32. <sect2 role="installation">
  33. <title>Installation of Python 3</title>
  34. <para>First, a header file needs to be fixed:</para>
  35. <screen><userinput remap="pre">sed 's|cpython/||' -i Include/cpython/pystate.h</userinput></screen>
  36. <para>Prepare Python for compilation:</para>
  37. <screen><userinput remap="configure">./configure --prefix=/usr \
  38. --enable-shared \
  39. --with-system-expat \
  40. --with-system-ffi \
  41. --with-ensurepip=yes</userinput></screen>
  42. <variablelist>
  43. <title>The meaning of the configure options:</title>
  44. <varlistentry>
  45. <term><parameter>--with-system-expat</parameter></term>
  46. <listitem>
  47. <para>This switch enables linking against system version of
  48. <application>Expat</application>.</para>
  49. </listitem>
  50. </varlistentry>
  51. <varlistentry>
  52. <term><parameter>--with-system-ffi</parameter></term>
  53. <listitem>
  54. <para>This switch enables linking against system version of
  55. <application>libffi</application>.</para>
  56. </listitem>
  57. </varlistentry>
  58. <varlistentry>
  59. <term><parameter>--with-ensurepip=yes</parameter></term>
  60. <listitem>
  61. <para>This switch enables building <command>pip</command> and
  62. <command>setuptools</command> packaging programs.</para>
  63. </listitem>
  64. </varlistentry>
  65. </variablelist>
  66. <para>Compile the package:</para>
  67. <screen><userinput remap="make">make</userinput></screen>
  68. <para>To test the results, issue:</para>
  69. <screen><userinput remap="test">make test</userinput></screen>
  70. <para>Some tests requiring a network connection or additional packages are
  71. skipped. The test named test_normalization is known to fail. For
  72. more comprehensive results, the tests can be rerun when Python 3 is
  73. reinstalled in BLFS.</para>
  74. <para>Install the package:</para>
  75. <screen><userinput remap="install">make install</userinput></screen>
  76. <para>If desired, install the preformatted documentation:</para>
  77. <screen><userinput remap="install">install -v -dm755 /usr/share/doc/python-&python-version;/html
  78. tar --strip-components=1 \
  79. --no-same-owner \
  80. --no-same-permissions \
  81. -C /usr/share/doc/python-&python-version;/html \
  82. -xvf ../python-&python-version;-docs-html.tar.bz2</userinput></screen>
  83. <variablelist>
  84. <title>The meaning of the documentation install commands:</title>
  85. <varlistentry>
  86. <term><option>--no-same-owner</option> and <option>--no-same-permissions</option></term>
  87. <listitem>
  88. <para>Ensure the installed files have the correct ownership and
  89. permissions. Without these options, using <application>tar</application>
  90. will install the package files with the upstream creator's values.
  91. </para>
  92. </listitem>
  93. </varlistentry>
  94. </variablelist>
  95. </sect2>
  96. <sect2 id="contents-python" role="content">
  97. <title>Contents of Python 3</title>
  98. <segmentedlist>
  99. <segtitle>Installed Programs</segtitle>
  100. <segtitle>Installed Library</segtitle>
  101. <segtitle>Installed Directories</segtitle>
  102. <seglistitem>
  103. <seg>
  104. 2to3, idle3, pip3, pydoc3, python3, and python3-config
  105. </seg>
  106. <seg>
  107. libpython&python-minor;.so and libpython3.so
  108. </seg>
  109. <seg>
  110. /usr/include/python&python-minor;,
  111. /usr/lib/python3, and
  112. /usr/share/doc/python-&python-version;
  113. </seg>
  114. </seglistitem>
  115. </segmentedlist>
  116. <variablelist>
  117. <bridgehead renderas="sect3">Short Descriptions</bridgehead>
  118. <?dbfo list-presentation="list"?>
  119. <?dbhtml list-presentation="table"?>
  120. <varlistentry id="python-2to3">
  121. <term><command>2to3</command></term>
  122. <listitem>
  123. <para>
  124. is a <application>Python</application> program that reads
  125. <application>Python 2.x</application> source code and applies a
  126. series of fixes to transform it into
  127. valid <application>Python 3.x</application> code
  128. </para>
  129. <indexterm zone="ch-system-Python">
  130. <primary sortas="b-2to3">2to3</primary>
  131. </indexterm>
  132. </listitem>
  133. </varlistentry>
  134. <varlistentry id="idle3">
  135. <term><command>idle3</command></term>
  136. <listitem>
  137. <para>
  138. is a wrapper script that opens a <application>Python</application>
  139. aware GUI editor. For this script to run, you must have installed
  140. <application>Tk</application> before Python so that the Tkinter
  141. Python module is built
  142. </para>
  143. <indexterm zone="ch-system-Python">
  144. <primary sortas="b-idle3">idle3</primary>
  145. </indexterm>
  146. </listitem>
  147. </varlistentry>
  148. <varlistentry id="pip3">
  149. <term><command>pip3</command></term>
  150. <listitem>
  151. <para>
  152. The package installer for Python. You can use pip to install
  153. packages from Python Package Index and other indexes
  154. </para>
  155. <indexterm zone="ch-system-Python">
  156. <primary sortas="b-pip3">pip3</primary>
  157. </indexterm>
  158. </listitem>
  159. </varlistentry>
  160. <varlistentry id="pydoc3">
  161. <term><command>pydoc3</command></term>
  162. <listitem>
  163. <para>
  164. is the <application>Python</application> documentation tool
  165. </para>
  166. <indexterm zone="ch-system-Python">
  167. <primary sortas="b-pydoc3">pydoc3</primary>
  168. </indexterm>
  169. </listitem>
  170. </varlistentry>
  171. <varlistentry id="python3">
  172. <term><command>python3</command></term>
  173. <listitem>
  174. <para>
  175. is an interpreted, interactive, object-oriented programming
  176. language
  177. </para>
  178. <indexterm zone="ch-system-Python">
  179. <primary sortas="b-python3">python3</primary>
  180. </indexterm>
  181. </listitem>
  182. </varlistentry>
  183. </variablelist>
  184. </sect2>
  185. </sect1>