##// END OF EJS Templates
minor doc fixes
Paul Ivanov -
Show More
@@ -1,401 +1,401
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 dependencies. Officially, IPython requires Python versions 2.6 to 2.7 and 3.1
13 to 3.2.
12 dependencies. Officially, IPython requires Python 2.6, 2.7, 3.1, or 3.2.
14 13
15 14 .. warning::
16 15
17 16 Officially, IPython supports Python versions 2.6 and 2.7.
18 17
19 18 IPython 0.11 has a hard syntax dependency on 2.6, and will no longer work
20 on Python <= 2.5.
19 on Python <= 2.5. You can find older versions of IPython which supported
20 Python <= 2.5 `here <http://archive.ipython.org/release/>`_
21 21
22 22 Some of the installation approaches use the :mod:`setuptools` package and its
23 23 :command:`easy_install` command line program. In many scenarios, this provides
24 24 the most simple method of installing IPython and its dependencies. It is not
25 25 required though. More information about :mod:`setuptools` can be found on its
26 26 website.
27 27
28 28 .. note::
29 29
30 30 On Windows, IPython *does* depend on :mod:`setuptools`, and it is recommended
31 31 that you install the :mod:`distribute` package, which improves
32 32 :mod:`setuptools` and fixes various bugs.
33 33
34 34 We hope to remove this dependency in 0.12.
35 35
36 36 More general information about installing Python packages can be found in
37 37 Python's documentation at http://www.python.org/doc/.
38 38
39 39 Quickstart
40 40 ==========
41 41
42 42 If you have :mod:`setuptools` installed and you are on OS X or Linux (not
43 43 Windows), the following will download and install IPython *and* the main
44 44 optional dependencies:
45 45
46 46 .. code-block:: bash
47 47
48 48 $ easy_install ipython[zmq,test]
49 49
50 50 This will get pyzmq, which is needed for
51 51 IPython's parallel computing features as well as the nose package, which will
52 52 enable you to run IPython's test suite.
53 53
54 54 To run IPython's test suite, use the :command:`iptest` command:
55 55
56 56 .. code-block:: bash
57 57
58 58 $ iptest
59 59
60 60 Read on for more specific details and instructions for Windows.
61 61
62 62 Installing IPython itself
63 63 =========================
64 64
65 65 Given a properly built Python, the basic interactive IPython shell will work
66 66 with no external dependencies. However, some Python distributions
67 67 (particularly on Windows and OS X), don't come with a working :mod:`readline`
68 68 module. The IPython shell will work without :mod:`readline`, but will lack
69 69 many features that users depend on, such as tab completion and command line
70 70 editing. If you install IPython with :mod:`setuptools`, (e.g. with `easy_install`),
71 71 then the appropriate :mod:`readline` for your platform will be installed.
72 72 See below for details of how to make sure you have a working :mod:`readline`.
73 73
74 74 Installation using easy_install
75 75 -------------------------------
76 76
77 77 If you have :mod:`setuptools` installed, the easiest way of getting IPython is
78 78 to simple use :command:`easy_install`:
79 79
80 80 .. code-block:: bash
81 81
82 82 $ easy_install ipython
83 83
84 84 That's it.
85 85
86 86 Installation from source
87 87 ------------------------
88 88
89 89 If you don't want to use :command:`easy_install`, or don't have it installed,
90 90 just grab the latest stable build of IPython from `here
91 <https://github.com/ipython/ipython/downloads>`_. Then do the following:
91 <http://ipython.org/download.html>`_. Then do the following:
92 92
93 93 .. code-block:: bash
94 94
95 95 $ tar -xzf ipython.tar.gz
96 96 $ cd ipython
97 97 $ python setup.py install
98 98
99 99 If you are installing to a location (like ``/usr/local``) that requires higher
100 100 permissions, you may need to run the last command with :command:`sudo`.
101 101
102 102 Windows
103 103 -------
104 104
105 105 .. note::
106 106
107 107 On Windows, IPython requires :mod:`setuptools` or :mod:`distribute`.
108 108
109 109 We hope to remove this dependency in 0.12.
110 110
111 111 There are a few caveats for Windows users. The main issue is that a basic
112 112 ``python setup.py install`` approach won't create ``.bat`` file or Start Menu
113 113 shortcuts, which most users want. To get an installation with these, you can
114 114 use any of the following alternatives:
115 115
116 116 1. Install using :command:`easy_install`.
117 117
118 118 2. Install using our binary ``.exe`` Windows installer, which can be found
119 119 `here <http://ipython.org/download.html>`_
120 120
121 121 3. Install from source, but using :mod:`setuptools` (``python setupegg.py
122 122 install``).
123 123
124 124 IPython by default runs in a terminal window, but the normal terminal
125 125 application supplied by Microsoft Windows is very primitive. You may want to
126 126 download the excellent and free Console_ application instead, which is a far
127 127 superior tool. You can even configure Console to give you by default an
128 128 IPython tab, which is very convenient to create new IPython sessions directly
129 129 from the working terminal.
130 130
131 131 .. _Console: http://sourceforge.net/projects/console
132 132
133 133 Note for Windows 64 bit users: you may have difficulties with the stock
134 134 installer on 64 bit systems; in this case (since we currently do not have 64
135 135 bit builds of the Windows installer) your best bet is to install from source
136 136 with the setuptools method indicated in #3 above. See `this bug report`_ for
137 137 further details.
138 138
139 139 .. _this bug report: https://bugs.launchpad.net/ipython/+bug/382214
140 140
141 141
142 142 Installing the development version
143 143 ----------------------------------
144 144
145 145 It is also possible to install the development version of IPython from our
146 146 `Git <http://git-scm.com/>`_ source code repository. To do this you will
147 147 need to have Git installed on your system. Then just do:
148 148
149 149 .. code-block:: bash
150 150
151 151 $ git clone https://github.com/ipython/ipython.git
152 152 $ cd ipython
153 153 $ python setup.py install
154 154
155 155 Again, this last step on Windows won't create ``.bat`` files or Start Menu
156 156 shortcuts, so you will have to use one of the other approaches listed above.
157 157
158 158 Some users want to be able to follow the development branch as it changes. If
159 159 you have :mod:`setuptools` installed, this is easy. Simply replace the last
160 160 step by:
161 161
162 162 .. code-block:: bash
163 163
164 164 $ python setupegg.py develop
165 165
166 166 This creates links in the right places and installs the command line script to
167 167 the appropriate places. Then, if you want to update your IPython at any time,
168 168 just do:
169 169
170 170 .. code-block:: bash
171 171
172 172 $ git pull
173 173
174 174 Basic optional dependencies
175 175 ===========================
176 176
177 177 There are a number of basic optional dependencies that most users will want to
178 178 get. These are:
179 179
180 180 * readline (for command line editing, tab completion, etc.)
181 181 * nose (to run the IPython test suite)
182 182 * pexpect (to use things like irunner)
183 183
184 184 If you are comfortable installing these things yourself, have at it, otherwise
185 185 read on for more details.
186 186
187 187 readline
188 188 --------
189 189
190 190 In principle, all Python distributions should come with a working
191 191 :mod:`readline` module. But, reality is not quite that simple. There are two
192 192 common situations where you won't have a working :mod:`readline` module:
193 193
194 194 * If you are using the built-in Python on Mac OS X.
195 195
196 196 * If you are running Windows, which doesn't have a :mod:`readline` module.
197 197
198 198 When IPython is installed with :mod:`setuptools`, (e.g. with `easy_install`),
199 199 readline is added as a dependency on OS X, and PyReadline on Windows, and will
200 200 be installed on your system. However, if you do not use setuptools, you may
201 201 have to install one of these packages yourself.
202 202
203 203 On OS X, the built-in Python doesn't not have :mod:`readline` because of
204 204 license issues. Starting with OS X 10.5 (Leopard), Apple's built-in Python has
205 205 a BSD-licensed not-quite-compatible readline replacement. As of IPython 0.9,
206 206 many of the issues related to the differences between readline and libedit seem
207 207 to have been resolved. While you may find libedit sufficient, we have
208 208 occasional reports of bugs with it and several developers who use OS X as their
209 209 main environment consider libedit unacceptable for productive, regular use with
210 210 IPython.
211 211
212 212 Therefore, we *strongly* recommend that on OS X you get the full
213 213 :mod:`readline` module. We will *not* consider completion/history problems to
214 214 be bugs for IPython if you are using libedit.
215 215
216 216 To get a working :mod:`readline` module, just do (with :mod:`setuptools`
217 217 installed):
218 218
219 219 .. code-block:: bash
220 220
221 221 $ easy_install readline
222 222
223 223 .. note::
224 224
225 225 Other Python distributions on OS X (such as fink, MacPorts and the official
226 226 python.org binaries) already have readline installed so you likely don't
227 227 have to do this step.
228 228
229 229 If needed, the readline egg can be build and installed from source (see the
230 230 wiki page at
231 231 http://web.archive.org/web/20090614162410/ipython.scipy.org/moin/InstallationOSXLeopard).
232 232
233 233 On Windows, you will need the PyReadline module. PyReadline is a separate,
234 234 Windows only implementation of readline that uses native Windows calls through
235 235 :mod:`ctypes`. The easiest way of installing PyReadline is you use the binary
236 236 installer available `here <https://launchpad.net/pyreadline/+download>`_.
237 237
238 238 nose
239 239 ----
240 240
241 241 To run the IPython test suite you will need the :mod:`nose` package. Nose
242 242 provides a great way of sniffing out and running all of the IPython tests. The
243 243 simplest way of getting nose, is to use :command:`easy_install`:
244 244
245 245 .. code-block:: bash
246 246
247 247 $ easy_install nose
248 248
249 249 Another way of getting this is to do:
250 250
251 251 .. code-block:: bash
252 252
253 253 $ easy_install ipython[test]
254 254
255 255 For more installation options, see the `nose website
256 256 <http://somethingaboutorange.com/mrl/projects/nose/>`_.
257 257
258 258 Once you have nose installed, you can run IPython's test suite using the
259 259 iptest command:
260 260
261 261 .. code-block:: bash
262 262
263 263 $ iptest
264 264
265 265 pexpect
266 266 -------
267 267
268 268 The pexpect_ package is used in IPython's :command:`irunner` script, as well as
269 269 for managing subprocesses. IPython now includes a version of pexpect in
270 270 :mod:`IPython.external`, but if you have installed pexpect, IPython will use
271 271 that instead. On Unix platforms (including OS X), just do:
272 272
273 273 .. code-block:: bash
274 274
275 275 $ easy_install pexpect
276 276
277 277 Windows users are out of luck as pexpect does not run there.
278 278
279 279 Dependencies for IPython.parallel (parallel computing)
280 280 ======================================================
281 281
282 282 :mod:`IPython.kernel` has been replaced by :mod:`IPython.parallel`,
283 283 which uses ZeroMQ for all communication.
284 284
285 285 IPython.parallel provides a nice architecture for parallel computing. The
286 286 main focus of this architecture is on interactive parallel computing. These
287 287 features require just one package: PyZMQ. See the next section for PyZMQ
288 288 details.
289 289
290 290 On a Unix style platform (including OS X), if you want to use
291 291 :mod:`setuptools`, you can just do:
292 292
293 293 .. code-block:: bash
294 294
295 295 $ easy_install ipython[zmq] # will include pyzmq
296 296
297 297 Security in IPython.parallel is provided by SSH tunnels. By default, Linux
298 298 and OSX clients will use the shell ssh command, but on Windows, we also
299 299 support tunneling with paramiko_.
300 300
301 301 Dependencies for IPython.zmq
302 302 ============================
303 303
304 304 pyzmq
305 305 -----
306 306
307 307 IPython 0.11 introduced some new functionality, including a two-process
308 308 execution model using ZeroMQ_ for communication. The Python bindings to ZeroMQ
309 309 are found in the PyZMQ_ project, which is easy_install-able once you have
310 310 ZeroMQ installed. If you are on Python 2.6 or 2.7 on OSX, or 2.7 on Windows,
311 311 pyzmq has eggs that include ZeroMQ itself.
312 312
313 313 IPython.zmq depends on pyzmq >= 2.1.4.
314 314
315 315 Dependencies for the IPython QT console
316 316 =======================================
317 317
318 318 pyzmq
319 319 -----
320 320
321 321 Like the :mod:`IPython.parallel` package, the QT Console requires ZeroMQ and
322 322 PyZMQ.
323 323
324 324 Qt
325 325 --
326 326
327 327 Also with 0.11, a new GUI was added using the work in :mod:`IPython.zmq`, which
328 328 can be launched with ``ipython qtconsole``. The GUI is built on Qt, and works
329 329 with either PyQt, which can be installed from the `PyQt website
330 330 <http://www.riverbankcomputing.co.uk/>`_, or `PySide
331 331 <http://www.pyside.org/>`_, from Nokia.
332 332
333 333 pygments
334 334 --------
335 335
336 336 The syntax-highlighting in ``ipython qtconsole`` is done with the pygments_
337 337 project, which is easy_install-able.
338 338
339 339 .. _installnotebook:
340 340
341 341 Dependencies for the IPython HTML notebook
342 342 ==========================================
343 343
344 344 The IPython notebook is a notebook-style web interface to IPython and can be
345 345 started withe command ``ipython notebook``.
346 346
347 347 pyzmq
348 348 -----
349 349
350 350 Like the :mod:`IPython.parallel` and :mod:`IPython.frontend.qt.console` packages,
351 351 the HTML notebook requires ZeroMQ and PyZMQ.
352 352
353 353 Tornado
354 354 -------
355 355
356 356 The IPython notebook uses the Tornado_ project for its HTTP server. Tornado 2.1
357 357 is required, in order to support current versions of browsers, due to an update
358 358 to the websocket protocol.
359 359
360 360
361 361 MathJax
362 362 -------
363 363
364 364 The IPython notebook uses the MathJax_ Javascript library for rendering LaTeX
365 365 in web browsers. Because MathJax is large, we don't include it with
366 366 IPython. Normally IPython will load MathJax from a CDN, but if you have a slow
367 367 network connection, or want to use LaTeX without an internet connection at all,
368 368 we do include a utility to aid in downloading MathJax and installing it into
369 369 the proper location::
370 370
371 371 from IPython.external.mathjax import install_mathjax
372 372 install_mathjax()
373 373
374 374 This function does require write access to the IPython install directory, so if you
375 375 have a system-wide Python install, it may need to be done from a ``sudo python`` session.
376 376
377 377 Browser Compatibility
378 378 ---------------------
379 379
380 380 The notebook uses WebSockets and the flexible box model. These features are
381 381 available in the following browsers:
382 382
383 383 * Chrome.
384 384 * Safari.
385 385 * Firefox 4 and 5. These browsers have WebSocket support, but it is disabled by
386 386 default. You can enable it by entering ``about:config`` in the URL bar and then
387 387 setting ``network.websocket.enabled`` and ``network.websocket.override-security-block``
388 388 to ``true``.
389 389 * Firefox 6. Starting with version 6, Firefox has WebSocket support enabled by default.
390 390
391 391 Internet Explorer 9 does not support WebSockets or the flexible box model, but
392 392 these features should appear in Internet Explorer 10.
393 393
394 394
395 395 .. _ZeroMQ: http://www.zeromq.org
396 396 .. _PyZMQ: https://github.com/zeromq/pyzmq
397 397 .. _paramiko: https://github.com/robey/paramiko
398 398 .. _pygments: http://pygments.org
399 399 .. _pexpect: http://www.noah.org/wiki/Pexpect
400 400 .. _Tornado: http://www.tornadoweb.org
401 401 .. _MathJax: http://www.mathjax.org
@@ -1,100 +1,100
1 1 .. _tips:
2 2
3 3 =====================
4 4 IPython Tips & Tricks
5 5 =====================
6 6
7 The `IPython cookbook <http://wiki.ipython.org/index.php?title=Cookbook>`_ details more
8 things you can do with IPython.
7 The `IPython cookbook <http://wiki.ipython.org/Cookbook>`_ details more things
8 you can do with IPython.
9 9
10 10 .. This is not in the current version:
11 11
12 12
13 13 Embed IPython in your programs
14 14 ------------------------------
15 15
16 16 A few lines of code are enough to load a complete IPython inside your own
17 17 programs, giving you the ability to work with your data interactively after
18 18 automatic processing has been completed. See :ref:`the embedding section <embedding>`.
19 19
20 20 Run doctests
21 21 ------------
22 22
23 23 Run your doctests from within IPython for development and debugging. The
24 24 special %doctest_mode command toggles a mode where the prompt, output and
25 25 exceptions display matches as closely as possible that of the default Python
26 26 interpreter. In addition, this mode allows you to directly paste in code that
27 27 contains leading '>>>' prompts, even if they have extra leading whitespace
28 28 (as is common in doctest files). This combined with the ``%history -t`` call
29 29 to see your translated history allows for an easy doctest workflow, where you
30 30 can go from doctest to interactive execution to pasting into valid Python code
31 31 as needed.
32 32
33 33 Use IPython to present interactive demos
34 34 ----------------------------------------
35 35
36 36 Use the :class:`IPython.lib.demo.Demo` class to load any Python script as an interactive
37 37 demo. With a minimal amount of simple markup, you can control the execution of
38 38 the script, stopping as needed. See :ref:`here <interactive_demos>` for more.
39 39
40 40 Suppress output
41 41 ---------------
42 42
43 43 Put a ';' at the end of a line to suppress the printing of output. This is
44 44 useful when doing calculations which generate long output you are not
45 45 interested in seeing.
46 46
47 47 Lightweight 'version control'
48 48 -----------------------------
49 49
50 50 When you call ``%edit`` with no arguments, IPython opens an empty editor
51 51 with a temporary file, and it returns the contents of your editing
52 52 session as a string variable. Thanks to IPython's output caching
53 53 mechanism, this is automatically stored::
54 54
55 55 In [1]: %edit
56 56
57 57 IPython will make a temporary file named: /tmp/ipython_edit_yR-HCN.py
58 58
59 59 Editing... done. Executing edited code...
60 60
61 61 hello - this is a temporary file
62 62
63 63 Out[1]: "print 'hello - this is a temporary file'\n"
64 64
65 65 Now, if you call ``%edit -p``, IPython tries to open an editor with the
66 66 same data as the last time you used %edit. So if you haven't used %edit
67 67 in the meantime, this same contents will reopen; however, it will be
68 68 done in a new file. This means that if you make changes and you later
69 69 want to find an old version, you can always retrieve it by using its
70 70 output number, via '%edit _NN', where NN is the number of the output
71 71 prompt.
72 72
73 73 Continuing with the example above, this should illustrate this idea::
74 74
75 75 In [2]: edit -p
76 76
77 77 IPython will make a temporary file named: /tmp/ipython_edit_nA09Qk.py
78 78
79 79 Editing... done. Executing edited code...
80 80
81 81 hello - now I made some changes
82 82
83 83 Out[2]: "print 'hello - now I made some changes'\n"
84 84
85 85 In [3]: edit _1
86 86
87 87 IPython will make a temporary file named: /tmp/ipython_edit_gy6-zD.py
88 88
89 89 Editing... done. Executing edited code...
90 90
91 91 hello - this is a temporary file
92 92
93 93 IPython version control at work :)
94 94
95 95 Out[3]: "print 'hello - this is a temporary file'\nprint 'IPython version control at work :)'\n"
96 96
97 97
98 98 This section was written after a contribution by Alexander Belchenko on
99 99 the IPython user list.
100 100
General Comments 0
You need to be logged in to leave comments. Login now