Show More
@@ -1,331 +1,345 b'' | |||
|
1 | 1 | Overview |
|
2 | 2 | ======== |
|
3 | 3 | |
|
4 | 4 | This document describes the steps required to install IPython. IPython is |
|
5 | 5 | organized into a number of subpackages, each of which has its own dependencies. |
|
6 | 6 | All of the subpackages come with IPython, so you don't need to download and |
|
7 | 7 | install them separately. However, to use a given subpackage, you will need to |
|
8 | 8 | install all of its dependencies. |
|
9 | 9 | |
|
10 | 10 | |
|
11 | 11 | Please let us know if you have problems installing IPython or any of its |
|
12 | 12 | dependencies. Officially, IPython requires Python version 2.6 or 2.7. There |
|
13 | 13 | is an experimental port of IPython for Python3 `on GitHub |
|
14 | 14 | <https://github.com/ipython/ipython-py3k>`_ |
|
15 | 15 | |
|
16 | 16 | .. warning:: |
|
17 | 17 | |
|
18 | 18 | Officially, IPython supports Python versions 2.6 and 2.7. |
|
19 | 19 | |
|
20 | 20 | IPython 0.11 has a hard syntax dependency on 2.6, and will no longer work |
|
21 | 21 | on Python <= 2.5. |
|
22 | 22 | |
|
23 | 23 | Some of the installation approaches use the :mod:`setuptools` package and its |
|
24 | 24 | :command:`easy_install` command line program. In many scenarios, this provides |
|
25 | 25 | the most simple method of installing IPython and its dependencies. It is not |
|
26 | 26 | required though. More information about :mod:`setuptools` can be found on its |
|
27 | 27 | website. |
|
28 | 28 | |
|
29 | .. note:: | |
|
30 | ||
|
31 | On Windows, IPython *does* depend on :mod:`setuptools`, and it is recommended | |
|
32 | that you install the :mod:`distribute` package, which improves | |
|
33 | :mod:`setuptools` and fixes various bugs. | |
|
34 | ||
|
35 | We hope to remove this dependency in 0.12. | |
|
36 | ||
|
29 | 37 | More general information about installing Python packages can be found in |
|
30 | 38 | Python's documentation at http://www.python.org/doc/. |
|
31 | 39 | |
|
32 | 40 | Quickstart |
|
33 | 41 | ========== |
|
34 | 42 | |
|
35 | 43 | If you have :mod:`setuptools` installed and you are on OS X or Linux (not |
|
36 | 44 | Windows), the following will download and install IPython *and* the main |
|
37 | 45 | optional dependencies: |
|
38 | 46 | |
|
39 | 47 | .. code-block:: bash |
|
40 | 48 | |
|
41 | 49 | $ easy_install ipython[zmq,test] |
|
42 | 50 | |
|
43 | 51 | This will get pyzmq, which is needed for |
|
44 | 52 | IPython's parallel computing features as well as the nose package, which will |
|
45 | 53 | enable you to run IPython's test suite. |
|
46 | 54 | |
|
47 | 55 | .. warning:: |
|
48 | 56 | |
|
49 | 57 | IPython's test system is being refactored and currently the |
|
50 | 58 | :command:`iptest` shown below does not work. More details about the |
|
51 | 59 | testing situation can be found :ref:`here <testing>` |
|
52 | 60 | |
|
53 | 61 | To run IPython's test suite, use the :command:`iptest` command: |
|
54 | 62 | |
|
55 | 63 | .. code-block:: bash |
|
56 | 64 | |
|
57 | 65 | $ iptest |
|
58 | 66 | |
|
59 | 67 | Read on for more specific details and instructions for Windows. |
|
60 | 68 | |
|
61 | 69 | Installing IPython itself |
|
62 | 70 | ========================= |
|
63 | 71 | |
|
64 | 72 | Given a properly built Python, the basic interactive IPython shell will work |
|
65 | 73 | with no external dependencies. However, some Python distributions |
|
66 | 74 | (particularly on Windows and OS X), don't come with a working :mod:`readline` |
|
67 | 75 | module. The IPython shell will work without :mod:`readline`, but will lack |
|
68 | 76 | many features that users depend on, such as tab completion and command line |
|
69 | 77 | editing. If you install IPython with :mod:`setuptools`, (e.g. with `easy_install`), |
|
70 | 78 | then the appropriate :mod:`readline` for your platform will be installed. |
|
71 | 79 | See below for details of how to make sure you have a working :mod:`readline`. |
|
72 | 80 | |
|
73 | 81 | Installation using easy_install |
|
74 | 82 | ------------------------------- |
|
75 | 83 | |
|
76 | 84 | If you have :mod:`setuptools` installed, the easiest way of getting IPython is |
|
77 | 85 | to simple use :command:`easy_install`: |
|
78 | 86 | |
|
79 | 87 | .. code-block:: bash |
|
80 | 88 | |
|
81 | 89 | $ easy_install ipython |
|
82 | 90 | |
|
83 | 91 | That's it. |
|
84 | 92 | |
|
85 | 93 | Installation from source |
|
86 | 94 | ------------------------ |
|
87 | 95 | |
|
88 | 96 | If you don't want to use :command:`easy_install`, or don't have it installed, |
|
89 | 97 | just grab the latest stable build of IPython from `here |
|
90 | 98 | <https://github.com/ipython/ipython/downloads>`_. Then do the following: |
|
91 | 99 | |
|
92 | 100 | .. code-block:: bash |
|
93 | 101 | |
|
94 | 102 | $ tar -xzf ipython.tar.gz |
|
95 | 103 | $ cd ipython |
|
96 | 104 | $ python setup.py install |
|
97 | 105 | |
|
98 | 106 | If you are installing to a location (like ``/usr/local``) that requires higher |
|
99 | 107 | permissions, you may need to run the last command with :command:`sudo`. |
|
100 | 108 | |
|
101 | 109 | Windows |
|
102 | 110 | ------- |
|
103 | 111 | |
|
112 | .. note:: | |
|
113 | ||
|
114 | On Windows, IPython requires :mod:`setuptools` or :mod:`distribute`. | |
|
115 | ||
|
116 | We hope to remove this dependency in 0.12. | |
|
117 | ||
|
104 | 118 | There are a few caveats for Windows users. The main issue is that a basic |
|
105 | 119 | ``python setup.py install`` approach won't create ``.bat`` file or Start Menu |
|
106 | 120 | shortcuts, which most users want. To get an installation with these, you can |
|
107 | 121 | use any of the following alternatives: |
|
108 | 122 | |
|
109 | 123 | 1. Install using :command:`easy_install`. |
|
110 | 124 | |
|
111 | 125 | 2. Install using our binary ``.exe`` Windows installer, which can be found |
|
112 | 126 | `here <http://ipython.scipy.org/dist/>`_ |
|
113 | 127 | |
|
114 | 128 | 3. Install from source, but using :mod:`setuptools` (``python setupegg.py |
|
115 | 129 | install``). |
|
116 | 130 | |
|
117 | 131 | IPython by default runs in a terminal window, but the normal terminal |
|
118 | 132 | application supplied by Microsoft Windows is very primitive. You may want to |
|
119 | 133 | download the excellent and free Console_ application instead, which is a far |
|
120 | 134 | superior tool. You can even configure Console to give you by default an |
|
121 | 135 | IPython tab, which is very convenient to create new IPython sessions directly |
|
122 | 136 | from the working terminal. |
|
123 | 137 | |
|
124 | 138 | .. _Console: http://sourceforge.net/projects/console |
|
125 | 139 | |
|
126 | 140 | Note for Windows 64 bit users: you may have difficulties with the stock |
|
127 | 141 | installer on 64 bit systems; in this case (since we currently do not have 64 |
|
128 | 142 | bit builds of the Windows installer) your best bet is to install from source |
|
129 | 143 | with the setuptools method indicated in #3 above. See `this bug report`_ for |
|
130 | 144 | further details. |
|
131 | 145 | |
|
132 | 146 | .. _this bug report: https://bugs.launchpad.net/ipython/+bug/382214 |
|
133 | 147 | |
|
134 | 148 | |
|
135 | 149 | Installing the development version |
|
136 | 150 | ---------------------------------- |
|
137 | 151 | |
|
138 | 152 | It is also possible to install the development version of IPython from our |
|
139 | 153 | `Git <http://git-scm.com/>`_ source code repository. To do this you will |
|
140 | 154 | need to have Git installed on your system. Then just do: |
|
141 | 155 | |
|
142 | 156 | .. code-block:: bash |
|
143 | 157 | |
|
144 | 158 | $ git clone https://github.com/ipython/ipython.git |
|
145 | 159 | $ cd ipython |
|
146 | 160 | $ python setup.py install |
|
147 | 161 | |
|
148 | 162 | Again, this last step on Windows won't create ``.bat`` files or Start Menu |
|
149 | 163 | shortcuts, so you will have to use one of the other approaches listed above. |
|
150 | 164 | |
|
151 | 165 | Some users want to be able to follow the development branch as it changes. If |
|
152 | 166 | you have :mod:`setuptools` installed, this is easy. Simply replace the last |
|
153 | 167 | step by: |
|
154 | 168 | |
|
155 | 169 | .. code-block:: bash |
|
156 | 170 | |
|
157 | 171 | $ python setupegg.py develop |
|
158 | 172 | |
|
159 | 173 | This creates links in the right places and installs the command line script to |
|
160 | 174 | the appropriate places. Then, if you want to update your IPython at any time, |
|
161 | 175 | just do: |
|
162 | 176 | |
|
163 | 177 | .. code-block:: bash |
|
164 | 178 | |
|
165 | 179 | $ git pull |
|
166 | 180 | |
|
167 | 181 | Basic optional dependencies |
|
168 | 182 | =========================== |
|
169 | 183 | |
|
170 | 184 | There are a number of basic optional dependencies that most users will want to |
|
171 | 185 | get. These are: |
|
172 | 186 | |
|
173 | 187 | * readline (for command line editing, tab completion, etc.) |
|
174 | 188 | * nose (to run the IPython test suite) |
|
175 | 189 | * pexpect (to use things like irunner) |
|
176 | 190 | |
|
177 | 191 | If you are comfortable installing these things yourself, have at it, otherwise |
|
178 | 192 | read on for more details. |
|
179 | 193 | |
|
180 | 194 | readline |
|
181 | 195 | -------- |
|
182 | 196 | |
|
183 | 197 | In principle, all Python distributions should come with a working |
|
184 | 198 | :mod:`readline` module. But, reality is not quite that simple. There are two |
|
185 | 199 | common situations where you won't have a working :mod:`readline` module: |
|
186 | 200 | |
|
187 | 201 | * If you are using the built-in Python on Mac OS X. |
|
188 | 202 | |
|
189 | 203 | * If you are running Windows, which doesn't have a :mod:`readline` module. |
|
190 | 204 | |
|
191 | 205 | When IPython is installed with :mod:`setuptools`, (e.g. with `easy_install`), |
|
192 | 206 | readline is added as a dependency on OS X, and PyReadline on Windows, and will |
|
193 | 207 | be installed on your system. However, if you do not use setuptools, you may |
|
194 | 208 | have to install one of these packages yourself. |
|
195 | 209 | |
|
196 | 210 | On OS X, the built-in Python doesn't not have :mod:`readline` because of |
|
197 | 211 | license issues. Starting with OS X 10.5 (Leopard), Apple's built-in Python has |
|
198 | 212 | a BSD-licensed not-quite-compatible readline replacement. As of IPython 0.9, |
|
199 | 213 | many of the issues related to the differences between readline and libedit seem |
|
200 | 214 | to have been resolved. While you may find libedit sufficient, we have |
|
201 | 215 | occasional reports of bugs with it and several developers who use OS X as their |
|
202 | 216 | main environment consider libedit unacceptable for productive, regular use with |
|
203 | 217 | IPython. |
|
204 | 218 | |
|
205 | 219 | Therefore, we *strongly* recommend that on OS X you get the full |
|
206 | 220 | :mod:`readline` module. We will *not* consider completion/history problems to |
|
207 | 221 | be bugs for IPython if you are using libedit. |
|
208 | 222 | |
|
209 | 223 | To get a working :mod:`readline` module, just do (with :mod:`setuptools` |
|
210 | 224 | installed): |
|
211 | 225 | |
|
212 | 226 | .. code-block:: bash |
|
213 | 227 | |
|
214 | 228 | $ easy_install readline |
|
215 | 229 | |
|
216 | 230 | .. note:: |
|
217 | 231 | |
|
218 | 232 | Other Python distributions on OS X (such as fink, MacPorts and the official |
|
219 | 233 | python.org binaries) already have readline installed so you likely don't |
|
220 | 234 | have to do this step. |
|
221 | 235 | |
|
222 | 236 | If needed, the readline egg can be build and installed from source (see the |
|
223 | 237 | wiki page at http://ipython.scipy.org/moin/InstallationOSXLeopard). |
|
224 | 238 | |
|
225 | 239 | On Windows, you will need the PyReadline module. PyReadline is a separate, |
|
226 | 240 | Windows only implementation of readline that uses native Windows calls through |
|
227 | 241 | :mod:`ctypes`. The easiest way of installing PyReadline is you use the binary |
|
228 | 242 | installer available `here <https://launchpad.net/pyreadline/+download>`_. |
|
229 | 243 | |
|
230 | 244 | nose |
|
231 | 245 | ---- |
|
232 | 246 | |
|
233 | 247 | To run the IPython test suite you will need the :mod:`nose` package. Nose |
|
234 | 248 | provides a great way of sniffing out and running all of the IPython tests. The |
|
235 | 249 | simplest way of getting nose, is to use :command:`easy_install`: |
|
236 | 250 | |
|
237 | 251 | .. code-block:: bash |
|
238 | 252 | |
|
239 | 253 | $ easy_install nose |
|
240 | 254 | |
|
241 | 255 | Another way of getting this is to do: |
|
242 | 256 | |
|
243 | 257 | .. code-block:: bash |
|
244 | 258 | |
|
245 | 259 | $ easy_install ipython[test] |
|
246 | 260 | |
|
247 | 261 | For more installation options, see the `nose website |
|
248 | 262 | <http://somethingaboutorange.com/mrl/projects/nose/>`_. |
|
249 | 263 | |
|
250 | 264 | .. warning:: |
|
251 | 265 | |
|
252 | 266 | As described above, the :command:`iptest` command currently doesn't work. |
|
253 | 267 | |
|
254 | 268 | Once you have nose installed, you can run IPython's test suite using the |
|
255 | 269 | iptest command: |
|
256 | 270 | |
|
257 | 271 | .. code-block:: bash |
|
258 | 272 | |
|
259 | 273 | $ iptest |
|
260 | 274 | |
|
261 | 275 | pexpect |
|
262 | 276 | ------- |
|
263 | 277 | |
|
264 | 278 | The pexpect package is used in IPython's :command:`irunner` script, as well as |
|
265 | 279 | for managing subprocesses [pexpect]_. IPython now includes a version of pexpect |
|
266 | 280 | in :mod:`IPython.external`, but if you have installed pexpect, IPython will use |
|
267 | 281 | that instead. On Unix platforms (including OS X), just do: |
|
268 | 282 | |
|
269 | 283 | .. code-block:: bash |
|
270 | 284 | |
|
271 | 285 | $ easy_install pexpect |
|
272 | 286 | |
|
273 | 287 | Windows users are out of luck as pexpect does not run there. |
|
274 | 288 | |
|
275 | 289 | Dependencies for IPython.parallel (parallel computing) |
|
276 | 290 | ====================================================== |
|
277 | 291 | |
|
278 | 292 | :mod:`IPython.kernel` has been replaced by :mod:`IPython.parallel`, |
|
279 | 293 | which uses ZeroMQ for all communication. |
|
280 | 294 | |
|
281 | 295 | IPython.parallel provides a nice architecture for parallel computing. The |
|
282 | 296 | main focus of this architecture is on interactive parallel computing. These |
|
283 | 297 | features require just one package: pyzmq. See the next section for pyzmq |
|
284 | 298 | details. |
|
285 | 299 | |
|
286 | 300 | On a Unix style platform (including OS X), if you want to use |
|
287 | 301 | :mod:`setuptools`, you can just do: |
|
288 | 302 | |
|
289 | 303 | .. code-block:: bash |
|
290 | 304 | |
|
291 | 305 | $ easy_install ipython[zmq] # will include pyzmq |
|
292 | 306 | |
|
293 | 307 | Security in IPython.parallel is provided by SSH tunnels. By default, Linux |
|
294 | 308 | and OSX clients will use the shell ssh command, but on Windows, we also |
|
295 | 309 | support tunneling with paramiko [paramiko]_. |
|
296 | 310 | |
|
297 | 311 | Dependencies for IPython.zmq |
|
298 | 312 | ============================ |
|
299 | 313 | |
|
300 | 314 | pyzmq |
|
301 | 315 | ----- |
|
302 | 316 | |
|
303 | 317 | IPython 0.11 introduced some new functionality, including a two-process |
|
304 | 318 | execution model using ZeroMQ for communication [ZeroMQ]_. The Python bindings |
|
305 | 319 | to ZeroMQ are found in the pyzmq project, which is easy_install-able once you |
|
306 | 320 | have ZeroMQ installed. If you are on Python 2.6 or 2.7 on OSX, or 2.7 on Windows, |
|
307 | 321 | pyzmq has eggs that include ZeroMQ itself. |
|
308 | 322 | |
|
309 | 323 | IPython.zmq depends on pyzmq >= 2.1.4. |
|
310 | 324 | |
|
311 | 325 | Dependencies for ipython-qtconsole (new GUI) |
|
312 | 326 | ============================================ |
|
313 | 327 | |
|
314 | 328 | PyQt |
|
315 | 329 | ---- |
|
316 | 330 | |
|
317 | 331 | Also with 0.11, a new GUI was added using the work in :mod:`IPython.zmq`, |
|
318 | 332 | which can be launched with ``ipython-qtconsole``. The GUI is built on PyQt , |
|
319 | 333 | which can be installed from the |
|
320 | 334 | `PyQt website <http://www.riverbankcomputing.co.uk/>`_. |
|
321 | 335 | |
|
322 | 336 | pygments |
|
323 | 337 | -------- |
|
324 | 338 | |
|
325 | 339 | The syntax-highlighting in ``ipython-qtconsole`` is done with the pygments project, |
|
326 | 340 | which is easy_install-able [pygments]_. |
|
327 | 341 | |
|
328 | 342 | .. [ZeroMQ] ZeroMQ. http://www.zeromq.org |
|
329 | 343 | .. [paramiko] paramiko. https://github.com/robey/paramiko |
|
330 | 344 | .. [pygments] Pygments syntax highlighting. http://pygments.org |
|
331 | 345 | .. [pexpect] Pexpect. http://www.noah.org/wiki/Pexpect |
General Comments 0
You need to be logged in to leave comments.
Login now