Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="inst.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="inst.html" title='Installing Python Modules' /> | |
8 | <link rel='last' href='about.html' title='About this document...' /> | |
9 | <link rel='help' href='about.html' title='About this document...' /> | |
10 | <link rel="next" href="standard-install.html" /> | |
11 | <link rel="prev" href="inst.html" /> | |
12 | <link rel="parent" href="inst.html" /> | |
13 | <link rel="next" href="standard-install.html" /> | |
14 | <meta name='aesop' content='information' /> | |
15 | <title>1 Introduction</title> | |
16 | </head> | |
17 | <body> | |
18 | <DIV CLASS="navigation"> | |
19 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
20 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
21 | <tr> | |
22 | <td class='online-navigation'><a rel="prev" title="Installing Python Modules" | |
23 | href="inst.html"><img src='../icons/previous.png' | |
24 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
25 | <td class='online-navigation'><a rel="parent" title="Installing Python Modules" | |
26 | href="inst.html"><img src='../icons/up.png' | |
27 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
28 | <td class='online-navigation'><a rel="next" title="2 Standard Build and" | |
29 | href="standard-install.html"><img src='../icons/next.png' | |
30 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
31 | <td align="center" width="100%">Installing Python Modules</td> | |
32 | <td class='online-navigation'><img src='../icons/blank.png' | |
33 | border='0' height='32' alt='' width='32' /></td> | |
34 | <td class='online-navigation'><img src='../icons/blank.png' | |
35 | border='0' height='32' alt='' width='32' /></td> | |
36 | <td class='online-navigation'><img src='../icons/blank.png' | |
37 | border='0' height='32' alt='' width='32' /></td> | |
38 | </tr></table> | |
39 | <div class='online-navigation'> | |
40 | <b class="navlabel">Previous:</b> | |
41 | <a class="sectref" rel="prev" href="inst.html">Installing Python Modules</A> | |
42 | <b class="navlabel">Up:</b> | |
43 | <a class="sectref" rel="parent" href="inst.html">Installing Python Modules</A> | |
44 | <b class="navlabel">Next:</b> | |
45 | <a class="sectref" rel="next" href="standard-install.html">2 Standard Build and</A> | |
46 | </div> | |
47 | <hr /></div> | |
48 | </DIV> | |
49 | <!--End of Navigation Panel--> | |
50 | <div class='online-navigation'> | |
51 | <!--Table of Child-Links--> | |
52 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> | |
53 | ||
54 | <UL CLASS="ChildLinks"> | |
55 | <LI><A href="trivial-install.html#SECTION000110000000000000000">1.1 Best case: trivial installation</a> | |
56 | <LI><A href="trivial-install.html#SECTION000120000000000000000">1.2 The new standard: Distutils</a> | |
57 | </ul> | |
58 | <!--End of Table of Child-Links--> | |
59 | </div> | |
60 | <HR> | |
61 | ||
62 | <H1><A NAME="SECTION000100000000000000000"></A> | |
63 | <A NAME="intro"></A> | |
64 | <BR> | |
65 | 1 Introduction | |
66 | </H1> | |
67 | ||
68 | <P> | |
69 | Although Python's extensive standard library covers many programming | |
70 | needs, there often comes a time when you need to add some new | |
71 | functionality to your Python installation in the form of third-party | |
72 | modules. This might be necessary to support your own programming, or to | |
73 | support an application that you want to use and that happens to be | |
74 | written in Python. | |
75 | ||
76 | <P> | |
77 | In the past, there has been little support for adding third-party | |
78 | modules to an existing Python installation. With the introduction of | |
79 | the Python Distribution Utilities (Distutils for short) in Python 2.0, | |
80 | this changed. | |
81 | ||
82 | <P> | |
83 | This document is aimed primarily at the people who need to install | |
84 | third-party Python modules: end-users and system administrators who just | |
85 | need to get some Python application running, and existing Python | |
86 | programmers who want to add some new goodies to their toolbox. You | |
87 | don't need to know Python to read this document; there will be some | |
88 | brief forays into using Python's interactive mode to explore your | |
89 | installation, but that's it. If you're looking for information on how | |
90 | to distribute your own Python modules so that others may use them, see | |
91 | the <em class="citetitle"><a | |
92 | href="../dist/dist.html" | |
93 | title="Distributing Python Modules" | |
94 | >Distributing Python Modules</a></em> manual. | |
95 | ||
96 | <P> | |
97 | ||
98 | <H2><A NAME="SECTION000110000000000000000"></A> | |
99 | <A NAME="trivial-install"></A> | |
100 | <BR> | |
101 | 1.1 Best case: trivial installation | |
102 | </H2> | |
103 | ||
104 | <P> | |
105 | In the best case, someone will have prepared a special version of the | |
106 | module distribution you want to install that is targeted specifically at | |
107 | your platform and is installed just like any other software on your | |
108 | platform. For example, the module developer might make an executable | |
109 | installer available for Windows users, an RPM package for users of | |
110 | RPM-based Linux systems (Red Hat, SuSE, Mandrake, and many others), a | |
111 | Debian package for users of Debian-based Linux systems, and so forth. | |
112 | ||
113 | <P> | |
114 | In that case, you would download the installer appropriate to your | |
115 | platform and do the obvious thing with it: run it if it's an executable | |
116 | installer, <code>rpm --install</code> it if it's an RPM, etc. You don't need | |
117 | to run Python or a setup script, you don't need to compile | |
118 | anything--you might not even need to read any instructions (although | |
119 | it's always a good idea to do so anyways). | |
120 | ||
121 | <P> | |
122 | Of course, things will not always be that easy. You might be interested | |
123 | in a module distribution that doesn't have an easy-to-use installer for | |
124 | your platform. In that case, you'll have to start with the source | |
125 | distribution released by the module's author/maintainer. Installing | |
126 | from a source distribution is not too hard, as long as the modules are | |
127 | packaged in the standard way. The bulk of this document is about | |
128 | building and installing modules from standard source distributions. | |
129 | ||
130 | <P> | |
131 | ||
132 | <H2><A NAME="SECTION000120000000000000000"></A> | |
133 | <A NAME="new-standard"></A> | |
134 | <BR> | |
135 | 1.2 The new standard: Distutils | |
136 | </H2> | |
137 | ||
138 | <P> | |
139 | If you download a module source distribution, you can tell pretty | |
140 | quickly if it was packaged and distributed in the standard way, i.e. | |
141 | using the Distutils. First, the distribution's name and version number | |
142 | will be featured prominently in the name of the downloaded archive, e.g. | |
143 | <span class="file">foo-1.0.tar.gz</span> or <span class="file">widget-0.9.7.zip</span>. Next, the archive | |
144 | will unpack into a similarly-named directory: <span class="file">foo-1.0</span> or | |
145 | <span class="file">widget-0.9.7</span>. Additionally, the distribution will contain a | |
146 | setup script <span class="file">setup.py</span>, and a file named <span class="file">README.txt</span> or possibly | |
147 | just <span class="file">README</span>, which should explain that building and installing the | |
148 | module distribution is a simple matter of running | |
149 | ||
150 | <P> | |
151 | <div class="verbatim"><pre> | |
152 | python setup.py install | |
153 | </pre></div> | |
154 | ||
155 | <P> | |
156 | If all these things are true, then you already know how to build and | |
157 | install the modules you've just downloaded: Run the command above. | |
158 | Unless you need to install things in a non-standard way or customize the | |
159 | build process, you don't really need this manual. Or rather, the above | |
160 | command is everything you need to get out of this manual. | |
161 | ||
162 | <P> | |
163 | ||
164 | <DIV CLASS="navigation"> | |
165 | <div class='online-navigation'> | |
166 | <p></p><hr /> | |
167 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
168 | <tr> | |
169 | <td class='online-navigation'><a rel="prev" title="Installing Python Modules" | |
170 | href="inst.html"><img src='../icons/previous.png' | |
171 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
172 | <td class='online-navigation'><a rel="parent" title="Installing Python Modules" | |
173 | href="inst.html"><img src='../icons/up.png' | |
174 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
175 | <td class='online-navigation'><a rel="next" title="2 Standard Build and" | |
176 | href="standard-install.html"><img src='../icons/next.png' | |
177 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
178 | <td align="center" width="100%">Installing Python Modules</td> | |
179 | <td class='online-navigation'><img src='../icons/blank.png' | |
180 | border='0' height='32' alt='' width='32' /></td> | |
181 | <td class='online-navigation'><img src='../icons/blank.png' | |
182 | border='0' height='32' alt='' width='32' /></td> | |
183 | <td class='online-navigation'><img src='../icons/blank.png' | |
184 | border='0' height='32' alt='' width='32' /></td> | |
185 | </tr></table> | |
186 | <div class='online-navigation'> | |
187 | <b class="navlabel">Previous:</b> | |
188 | <a class="sectref" rel="prev" href="inst.html">Installing Python Modules</A> | |
189 | <b class="navlabel">Up:</b> | |
190 | <a class="sectref" rel="parent" href="inst.html">Installing Python Modules</A> | |
191 | <b class="navlabel">Next:</b> | |
192 | <a class="sectref" rel="next" href="standard-install.html">2 Standard Build and</A> | |
193 | </div> | |
194 | </div> | |
195 | <hr /> | |
196 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
197 | </DIV> | |
198 | <!--End of Navigation Panel--> | |
199 | <ADDRESS> | |
200 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
201 | </ADDRESS> | |
202 | </BODY> | |
203 | </HTML> |