Show More
@@ -1,448 +1,448 b'' | |||||
1 |
IPython requires Python 2. |
|
1 | IPython requires Python 2.7 or ≥ 3.3. | |
2 |
|
2 | |||
3 | .. note:: |
|
3 | .. note:: | |
4 |
|
4 | |||
5 |
If you need to use Python 2. |
|
5 | If you need to use Python 2.6 or 3.2, you can find IPython 1.0 | |
6 | `here <http://archive.ipython.org/release/>`__. |
|
6 | `here <http://archive.ipython.org/release/>`__. | |
7 |
|
7 | |||
8 | Quickstart |
|
8 | Quickstart | |
9 | ========== |
|
9 | ========== | |
10 |
|
10 | |||
11 | If you have :mod:`setuptools`, |
|
11 | If you have :mod:`setuptools`, | |
12 | the quickest way to get up and running with IPython is: |
|
12 | the quickest way to get up and running with IPython is: | |
13 |
|
13 | |||
14 | .. code-block:: bash |
|
14 | .. code-block:: bash | |
15 |
|
15 | |||
16 | $ easy_install ipython[all] |
|
16 | $ easy_install ipython[all] | |
17 |
|
17 | |||
18 | This will download and install IPython and its main optional dependencies: |
|
18 | This will download and install IPython and its main optional dependencies: | |
19 |
|
19 | |||
20 | - jinja2, needed for the notebook |
|
20 | - jinja2, needed for the notebook | |
21 | - sphinx, needed for nbconvert |
|
21 | - sphinx, needed for nbconvert | |
22 | - pyzmq, needed for IPython's parallel computing features, qt console and |
|
22 | - pyzmq, needed for IPython's parallel computing features, qt console and | |
23 | notebook |
|
23 | notebook | |
24 | - pygments, used by nbconvert and the Qt console for syntax highlighting |
|
24 | - pygments, used by nbconvert and the Qt console for syntax highlighting | |
25 | - tornado, needed by the web-based notebook |
|
25 | - tornado, needed by the web-based notebook | |
26 | - nose, used by the test suite |
|
26 | - nose, used by the test suite | |
27 | - readline (on OS X) or pyreadline (on Windows), needed for the terminal |
|
27 | - readline (on OS X) or pyreadline (on Windows), needed for the terminal | |
28 |
|
28 | |||
29 | To run IPython's test suite, use the :command:`iptest` command: |
|
29 | To run IPython's test suite, use the :command:`iptest` command: | |
30 |
|
30 | |||
31 | .. code-block:: bash |
|
31 | .. code-block:: bash | |
32 |
|
32 | |||
33 | $ iptest |
|
33 | $ iptest | |
34 |
|
34 | |||
35 | .. note:: |
|
35 | .. note:: | |
36 |
|
36 | |||
37 | .. code-block:: bash |
|
37 | .. code-block:: bash | |
38 |
|
38 | |||
39 | $ pip install ipython[all] |
|
39 | $ pip install ipython[all] | |
40 |
|
40 | |||
41 | will also work in many cases, but it will ignore the binary eggs |
|
41 | will also work in many cases, but it will ignore the binary eggs | |
42 | of packages such as pyzmq and readline, |
|
42 | of packages such as pyzmq and readline, | |
43 | which may be required for some users on Windows or OS X. |
|
43 | which may be required for some users on Windows or OS X. | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | Overview |
|
46 | Overview | |
47 | ======== |
|
47 | ======== | |
48 |
|
48 | |||
49 | This document describes in detail the steps required to install IPython, |
|
49 | This document describes in detail the steps required to install IPython, | |
50 | and its various optional dependencies. |
|
50 | and its various optional dependencies. | |
51 | For a few quick ways to get started with package managers or full Python distributions, |
|
51 | For a few quick ways to get started with package managers or full Python distributions, | |
52 | see `the install page <http://ipython.org/install.html>`_ of the IPython website. |
|
52 | see `the install page <http://ipython.org/install.html>`_ of the IPython website. | |
53 |
|
53 | |||
54 | IPython is organized into a number of subpackages, each of which has its own dependencies. |
|
54 | IPython is organized into a number of subpackages, each of which has its own dependencies. | |
55 | All of the subpackages come with IPython, so you don't need to download and |
|
55 | All of the subpackages come with IPython, so you don't need to download and | |
56 | install them separately. However, to use a given subpackage, you will need to |
|
56 | install them separately. However, to use a given subpackage, you will need to | |
57 | install all of its dependencies. |
|
57 | install all of its dependencies. | |
58 |
|
58 | |||
59 | Please let us know if you have problems installing IPython or any of its dependencies. |
|
59 | Please let us know if you have problems installing IPython or any of its dependencies. | |
60 |
|
60 | |||
61 | IPython and most dependencies can be installed via :command:`easy_install`, |
|
61 | IPython and most dependencies can be installed via :command:`easy_install`, | |
62 | provided by the :mod:`setuptools` package, or :command:`pip`. |
|
62 | provided by the :mod:`setuptools` package, or :command:`pip`. | |
63 | In many scenarios, this is the most simplest method of installing Python packages. |
|
63 | In many scenarios, this is the most simplest method of installing Python packages. | |
64 | More information about :mod:`setuptools` can be found on |
|
64 | More information about :mod:`setuptools` can be found on | |
65 | `its PyPI page <http://pypi.python.org/pypi/setuptools>`__. |
|
65 | `its PyPI page <http://pypi.python.org/pypi/setuptools>`__. | |
66 |
|
66 | |||
67 | .. note:: |
|
67 | .. note:: | |
68 |
|
68 | |||
69 | On Windows, IPython *requires* :mod:`setuptools`. We hope to |
|
69 | On Windows, IPython *requires* :mod:`setuptools`. We hope to | |
70 | change this in the future, but for now on Windows, you *must* install |
|
70 | change this in the future, but for now on Windows, you *must* install | |
71 | :mod:`setuptools` to use IPython. |
|
71 | :mod:`setuptools` to use IPython. | |
72 |
|
72 | |||
73 | More general information about installing Python packages can be found in |
|
73 | More general information about installing Python packages can be found in | |
74 | `Python's documentation <http://docs.python.org>`_. |
|
74 | `Python's documentation <http://docs.python.org>`_. | |
75 |
|
75 | |||
76 |
|
76 | |||
77 | Installing IPython itself |
|
77 | Installing IPython itself | |
78 | ========================= |
|
78 | ========================= | |
79 |
|
79 | |||
80 | Given a properly built Python, the basic interactive IPython shell will work |
|
80 | Given a properly built Python, the basic interactive IPython shell will work | |
81 | with no external dependencies. However, some Python distributions |
|
81 | with no external dependencies. However, some Python distributions | |
82 | (particularly on Windows and OS X), don't come with a working :mod:`readline` |
|
82 | (particularly on Windows and OS X), don't come with a working :mod:`readline` | |
83 | module. The IPython shell will work without :mod:`readline`, but will lack |
|
83 | module. The IPython shell will work without :mod:`readline`, but will lack | |
84 | many features that users depend on, such as tab completion and command line |
|
84 | many features that users depend on, such as tab completion and command line | |
85 | editing. If you install IPython with :mod:`setuptools`, (e.g. with |
|
85 | editing. If you install IPython with :mod:`setuptools`, (e.g. with | |
86 | `easy_install`), then the appropriate :mod:`readline` for your platform will be |
|
86 | `easy_install`), then the appropriate :mod:`readline` for your platform will be | |
87 | installed. See below for details of how to make sure you have a working |
|
87 | installed. See below for details of how to make sure you have a working | |
88 | :mod:`readline`. |
|
88 | :mod:`readline`. | |
89 |
|
89 | |||
90 | Installation using easy_install or pip |
|
90 | Installation using easy_install or pip | |
91 | -------------------------------------- |
|
91 | -------------------------------------- | |
92 |
|
92 | |||
93 | If you have :mod:`setuptools` or :mod:`pip`, the easiest way of getting IPython is |
|
93 | If you have :mod:`setuptools` or :mod:`pip`, the easiest way of getting IPython is | |
94 | to simply use :command:`easy_install` or :command:`pip`: |
|
94 | to simply use :command:`easy_install` or :command:`pip`: | |
95 |
|
95 | |||
96 | .. code-block:: bash |
|
96 | .. code-block:: bash | |
97 |
|
97 | |||
98 | $ pip install ipython |
|
98 | $ pip install ipython | |
99 |
|
99 | |||
100 | That's it. |
|
100 | That's it. | |
101 |
|
101 | |||
102 | .. note:: |
|
102 | .. note:: | |
103 |
|
103 | |||
104 | Many prefer :command:`pip` to :command:`easy_install`, but it ignores eggs (binary Python packages). |
|
104 | Many prefer :command:`pip` to :command:`easy_install`, but it ignores eggs (binary Python packages). | |
105 | This mainly affects pyzmq and readline, which are compiled packages and provide |
|
105 | This mainly affects pyzmq and readline, which are compiled packages and provide | |
106 | binary eggs. If you use :command:`pip` to install these packages, |
|
106 | binary eggs. If you use :command:`pip` to install these packages, | |
107 | it will always compile from source, which may not succeed. |
|
107 | it will always compile from source, which may not succeed. | |
108 |
|
108 | |||
109 | Installation from source |
|
109 | Installation from source | |
110 | ------------------------ |
|
110 | ------------------------ | |
111 |
|
111 | |||
112 | If you don't want to use :command:`easy_install`, or don't have it installed, |
|
112 | If you don't want to use :command:`easy_install`, or don't have it installed, | |
113 | just grab the latest stable build of IPython from `here |
|
113 | just grab the latest stable build of IPython from `here | |
114 | <http://ipython.org/download.html>`_. Then do the following: |
|
114 | <http://ipython.org/download.html>`_. Then do the following: | |
115 |
|
115 | |||
116 | .. code-block:: bash |
|
116 | .. code-block:: bash | |
117 |
|
117 | |||
118 | $ tar -xzf ipython.tar.gz |
|
118 | $ tar -xzf ipython.tar.gz | |
119 | $ cd ipython |
|
119 | $ cd ipython | |
120 | $ python setup.py install |
|
120 | $ python setup.py install | |
121 |
|
121 | |||
122 | If you are installing to a location (like ``/usr/local``) that requires higher |
|
122 | If you are installing to a location (like ``/usr/local``) that requires higher | |
123 | permissions, you may need to run the last command with :command:`sudo`. |
|
123 | permissions, you may need to run the last command with :command:`sudo`. | |
124 |
|
124 | |||
125 | Windows |
|
125 | Windows | |
126 | ------- |
|
126 | ------- | |
127 |
|
127 | |||
128 | As mentioned above, on Windows, IPython requires :mod:`setuptools`, and it also |
|
128 | As mentioned above, on Windows, IPython requires :mod:`setuptools`, and it also | |
129 | requires the PyReadline library to properly support coloring and keyboard |
|
129 | requires the PyReadline library to properly support coloring and keyboard | |
130 | management (features that the default windows console doesn't have). So on |
|
130 | management (features that the default windows console doesn't have). So on | |
131 | Windows, the installation procedure is: |
|
131 | Windows, the installation procedure is: | |
132 |
|
132 | |||
133 | 1. Install `setuptools <http://pypi.python.org/pypi/setuptools>`_. |
|
133 | 1. Install `setuptools <http://pypi.python.org/pypi/setuptools>`_. | |
134 |
|
134 | |||
135 | 2. Install `pyreadline <http://pypi.python.org/pypi/pyreadline>`_. You can use |
|
135 | 2. Install `pyreadline <http://pypi.python.org/pypi/pyreadline>`_. You can use | |
136 | the command ``easy_install pyreadline`` from a terminal, or the binary |
|
136 | the command ``easy_install pyreadline`` from a terminal, or the binary | |
137 | installer appropriate for your platform from the PyPI page. |
|
137 | installer appropriate for your platform from the PyPI page. | |
138 |
|
138 | |||
139 | 3. Install IPython itself, which you can download from `PyPI |
|
139 | 3. Install IPython itself, which you can download from `PyPI | |
140 | <http://pypi.python.org/pypi/ipython>`_ or from `our site |
|
140 | <http://pypi.python.org/pypi/ipython>`_ or from `our site | |
141 | <http://ipython.org/download.html>`_. Note that on Windows 7, you *must* |
|
141 | <http://ipython.org/download.html>`_. Note that on Windows 7, you *must* | |
142 | right-click and 'Run as administrator' for the Start menu shortcuts to be |
|
142 | right-click and 'Run as administrator' for the Start menu shortcuts to be | |
143 | created. |
|
143 | created. | |
144 |
|
144 | |||
145 | IPython by default runs in a terminal window, but the normal terminal |
|
145 | IPython by default runs in a terminal window, but the normal terminal | |
146 | application supplied by Microsoft Windows is very primitive. You may want to |
|
146 | application supplied by Microsoft Windows is very primitive. You may want to | |
147 | download the excellent and free Console_ application instead, which is a far |
|
147 | download the excellent and free Console_ application instead, which is a far | |
148 | superior tool. You can even configure Console to give you by default an |
|
148 | superior tool. You can even configure Console to give you by default an | |
149 | IPython tab, which is very convenient to create new IPython sessions directly |
|
149 | IPython tab, which is very convenient to create new IPython sessions directly | |
150 | from the working terminal. |
|
150 | from the working terminal. | |
151 |
|
151 | |||
152 | .. _Console: http://sourceforge.net/projects/console |
|
152 | .. _Console: http://sourceforge.net/projects/console | |
153 |
|
153 | |||
154 |
|
154 | |||
155 | Installing the development version |
|
155 | Installing the development version | |
156 | ---------------------------------- |
|
156 | ---------------------------------- | |
157 |
|
157 | |||
158 | It is also possible to install the development version of IPython from our |
|
158 | It is also possible to install the development version of IPython from our | |
159 | `Git <http://git-scm.com/>`_ source code repository. To do this you will |
|
159 | `Git <http://git-scm.com/>`_ source code repository. To do this you will | |
160 | need to have Git installed on your system. Then just do: |
|
160 | need to have Git installed on your system. Then just do: | |
161 |
|
161 | |||
162 | .. code-block:: bash |
|
162 | .. code-block:: bash | |
163 |
|
163 | |||
164 | $ git clone --recursive https://github.com/ipython/ipython.git |
|
164 | $ git clone --recursive https://github.com/ipython/ipython.git | |
165 | $ cd ipython |
|
165 | $ cd ipython | |
166 | $ python setup.py install |
|
166 | $ python setup.py install | |
167 |
|
167 | |||
168 | Some users want to be able to follow the development branch as it changes. If |
|
168 | Some users want to be able to follow the development branch as it changes. If | |
169 | you have :mod:`setuptools` installed, this is easy. Simply replace the last |
|
169 | you have :mod:`setuptools` installed, this is easy. Simply replace the last | |
170 | step by: |
|
170 | step by: | |
171 |
|
171 | |||
172 | .. code-block:: bash |
|
172 | .. code-block:: bash | |
173 |
|
173 | |||
174 | $ python setupegg.py develop |
|
174 | $ python setupegg.py develop | |
175 |
|
175 | |||
176 | This creates links in the right places and installs the command line script to |
|
176 | This creates links in the right places and installs the command line script to | |
177 | the appropriate places. Then, if you want to update your IPython at any time, |
|
177 | the appropriate places. Then, if you want to update your IPython at any time, | |
178 | just do: |
|
178 | just do: | |
179 |
|
179 | |||
180 | .. code-block:: bash |
|
180 | .. code-block:: bash | |
181 |
|
181 | |||
182 | $ git pull |
|
182 | $ git pull | |
183 |
|
183 | |||
184 |
|
184 | |||
185 | Basic optional dependencies |
|
185 | Basic optional dependencies | |
186 | =========================== |
|
186 | =========================== | |
187 |
|
187 | |||
188 | There are a number of basic optional dependencies that most users will want to |
|
188 | There are a number of basic optional dependencies that most users will want to | |
189 | get. These are: |
|
189 | get. These are: | |
190 |
|
190 | |||
191 | * readline (for command line editing, tab completion, etc.) |
|
191 | * readline (for command line editing, tab completion, etc.) | |
192 | * nose (to run the IPython test suite) |
|
192 | * nose (to run the IPython test suite) | |
193 | * pexpect (to use things like irunner) |
|
193 | * pexpect (to use things like irunner) | |
194 |
|
194 | |||
195 | If you are comfortable installing these things yourself, have at it, otherwise |
|
195 | If you are comfortable installing these things yourself, have at it, otherwise | |
196 | read on for more details. |
|
196 | read on for more details. | |
197 |
|
197 | |||
198 | readline |
|
198 | readline | |
199 | -------- |
|
199 | -------- | |
200 |
|
200 | |||
201 | As indicated above, on Windows, PyReadline is a *mandatory* dependency. |
|
201 | As indicated above, on Windows, PyReadline is a *mandatory* dependency. | |
202 | PyReadline is a separate, Windows only implementation of readline that uses |
|
202 | PyReadline is a separate, Windows only implementation of readline that uses | |
203 | native Windows calls through :mod:`ctypes`. The easiest way of installing |
|
203 | native Windows calls through :mod:`ctypes`. The easiest way of installing | |
204 | PyReadline is you use the binary installer available `here |
|
204 | PyReadline is you use the binary installer available `here | |
205 | <http://pypi.python.org/pypi/pyreadline>`__. |
|
205 | <http://pypi.python.org/pypi/pyreadline>`__. | |
206 |
|
206 | |||
207 | On OSX, if you are using the built-in Python shipped by Apple, you will be |
|
207 | On OSX, if you are using the built-in Python shipped by Apple, you will be | |
208 | missing a full readline implementation as Apple ships instead a library called |
|
208 | missing a full readline implementation as Apple ships instead a library called | |
209 | ``libedit`` that provides only some of readline's functionality. While you may |
|
209 | ``libedit`` that provides only some of readline's functionality. While you may | |
210 | find libedit sufficient, we have occasional reports of bugs with it and several |
|
210 | find libedit sufficient, we have occasional reports of bugs with it and several | |
211 | developers who use OS X as their main environment consider libedit unacceptable |
|
211 | developers who use OS X as their main environment consider libedit unacceptable | |
212 | for productive, regular use with IPython. |
|
212 | for productive, regular use with IPython. | |
213 |
|
213 | |||
214 | Therefore, we *strongly* recommend that on OS X you get the full |
|
214 | Therefore, we *strongly* recommend that on OS X you get the full | |
215 | :mod:`readline` module. We will *not* consider completion/history problems to |
|
215 | :mod:`readline` module. We will *not* consider completion/history problems to | |
216 | be bugs for IPython if you are using libedit. |
|
216 | be bugs for IPython if you are using libedit. | |
217 |
|
217 | |||
218 | To get a working :mod:`readline` module, just do (with :mod:`setuptools` |
|
218 | To get a working :mod:`readline` module, just do (with :mod:`setuptools` | |
219 | installed): |
|
219 | installed): | |
220 |
|
220 | |||
221 | .. code-block:: bash |
|
221 | .. code-block:: bash | |
222 |
|
222 | |||
223 | $ easy_install readline |
|
223 | $ easy_install readline | |
224 |
|
224 | |||
225 | .. note:: |
|
225 | .. note:: | |
226 |
|
226 | |||
227 | Other Python distributions on OS X (such as fink, MacPorts and the official |
|
227 | Other Python distributions on OS X (such as fink, MacPorts and the official | |
228 | python.org binaries) already have readline installed so you likely don't |
|
228 | python.org binaries) already have readline installed so you likely don't | |
229 | have to do this step. |
|
229 | have to do this step. | |
230 |
|
230 | |||
231 | When IPython is installed with :mod:`setuptools`, (e.g. using the |
|
231 | When IPython is installed with :mod:`setuptools`, (e.g. using the | |
232 | ``easy_install`` command), readline is added as a dependency on OS X, and |
|
232 | ``easy_install`` command), readline is added as a dependency on OS X, and | |
233 | PyReadline on Windows, and will be installed on your system. However, if you |
|
233 | PyReadline on Windows, and will be installed on your system. However, if you | |
234 | do not use setuptools, you may have to install one of these packages yourself. |
|
234 | do not use setuptools, you may have to install one of these packages yourself. | |
235 |
|
235 | |||
236 |
|
236 | |||
237 | nose |
|
237 | nose | |
238 | ---- |
|
238 | ---- | |
239 |
|
239 | |||
240 | To run the IPython test suite you will need the :mod:`nose` package. Nose |
|
240 | To run the IPython test suite you will need the :mod:`nose` package. Nose | |
241 | provides a great way of sniffing out and running all of the IPython tests. The |
|
241 | provides a great way of sniffing out and running all of the IPython tests. The | |
242 | simplest way of getting nose is to use :command:`easy_install` or :command:`pip`: |
|
242 | simplest way of getting nose is to use :command:`easy_install` or :command:`pip`: | |
243 |
|
243 | |||
244 | .. code-block:: bash |
|
244 | .. code-block:: bash | |
245 |
|
245 | |||
246 | $ pip install nose |
|
246 | $ pip install nose | |
247 |
|
247 | |||
248 | Another way of getting this is to do: |
|
248 | Another way of getting this is to do: | |
249 |
|
249 | |||
250 | .. code-block:: bash |
|
250 | .. code-block:: bash | |
251 |
|
251 | |||
252 | $ pip install ipython[test] |
|
252 | $ pip install ipython[test] | |
253 |
|
253 | |||
254 | For more installation options, see the `nose website |
|
254 | For more installation options, see the `nose website | |
255 | <http://somethingaboutorange.com/mrl/projects/nose/>`_. |
|
255 | <http://somethingaboutorange.com/mrl/projects/nose/>`_. | |
256 |
|
256 | |||
257 | Once you have nose installed, you can run IPython's test suite using the |
|
257 | Once you have nose installed, you can run IPython's test suite using the | |
258 | iptest command: |
|
258 | iptest command: | |
259 |
|
259 | |||
260 | .. code-block:: bash |
|
260 | .. code-block:: bash | |
261 |
|
261 | |||
262 | $ iptest |
|
262 | $ iptest | |
263 |
|
263 | |||
264 | pexpect |
|
264 | pexpect | |
265 | ------- |
|
265 | ------- | |
266 |
|
266 | |||
267 | The pexpect_ package is used in IPython's :command:`irunner` script, as well as |
|
267 | The pexpect_ package is used in IPython's :command:`irunner` script, as well as | |
268 | for managing subprocesses. IPython now includes a version of pexpect in |
|
268 | for managing subprocesses. IPython now includes a version of pexpect in | |
269 | :mod:`IPython.external`, but if you have installed pexpect, IPython will use |
|
269 | :mod:`IPython.external`, but if you have installed pexpect, IPython will use | |
270 | that instead. On Unix platforms (including OS X), just do: |
|
270 | that instead. On Unix platforms (including OS X), just do: | |
271 |
|
271 | |||
272 | .. code-block:: bash |
|
272 | .. code-block:: bash | |
273 |
|
273 | |||
274 | $ pip install pexpect |
|
274 | $ pip install pexpect | |
275 |
|
275 | |||
276 | .. note:: |
|
276 | .. note:: | |
277 |
|
277 | |||
278 | On Python 3, you should actually install :mod:`pexpect-u`, |
|
278 | On Python 3, you should actually install :mod:`pexpect-u`, | |
279 | a unicode-safe fork of pexpect. |
|
279 | a unicode-safe fork of pexpect. | |
280 |
|
280 | |||
281 | Windows users are out of luck as pexpect does not run there. |
|
281 | Windows users are out of luck as pexpect does not run there. | |
282 |
|
282 | |||
283 | Dependencies for IPython.parallel (parallel computing) |
|
283 | Dependencies for IPython.parallel (parallel computing) | |
284 | ====================================================== |
|
284 | ====================================================== | |
285 |
|
285 | |||
286 | IPython.parallel provides a nice architecture for parallel computing, with a |
|
286 | IPython.parallel provides a nice architecture for parallel computing, with a | |
287 | focus on fluid interactive workflows. These features require just one package: |
|
287 | focus on fluid interactive workflows. These features require just one package: | |
288 | PyZMQ. See the next section for PyZMQ details. |
|
288 | PyZMQ. See the next section for PyZMQ details. | |
289 |
|
289 | |||
290 | On a Unix style platform (including OS X), if you want to use |
|
290 | On a Unix style platform (including OS X), if you want to use | |
291 | :mod:`setuptools`, you can just do: |
|
291 | :mod:`setuptools`, you can just do: | |
292 |
|
292 | |||
293 | .. code-block:: bash |
|
293 | .. code-block:: bash | |
294 |
|
294 | |||
295 | $ easy_install ipython[zmq] # will include pyzmq |
|
295 | $ easy_install ipython[zmq] # will include pyzmq | |
296 |
|
296 | |||
297 | Security in IPython.parallel is provided by SSH tunnels. By default, Linux |
|
297 | Security in IPython.parallel is provided by SSH tunnels. By default, Linux | |
298 | and OSX clients will use the shell ssh command, but on Windows, we also |
|
298 | and OSX clients will use the shell ssh command, but on Windows, we also | |
299 | support tunneling with paramiko_. |
|
299 | support tunneling with paramiko_. | |
300 |
|
300 | |||
301 | Dependencies for IPython.kernel.zmq |
|
301 | Dependencies for IPython.kernel.zmq | |
302 | =================================== |
|
302 | =================================== | |
303 |
|
303 | |||
304 | pyzmq |
|
304 | pyzmq | |
305 | ----- |
|
305 | ----- | |
306 |
|
306 | |||
307 | IPython 0.11 introduced some new functionality, including a two-process |
|
307 | IPython 0.11 introduced some new functionality, including a two-process | |
308 | execution model using ZeroMQ_ for communication. The Python bindings to ZeroMQ |
|
308 | execution model using ZeroMQ_ for communication. The Python bindings to ZeroMQ | |
309 | are found in the PyZMQ_ project, which is easy_install-able once you have |
|
309 | are found in the PyZMQ_ project, which is easy_install-able once you have | |
310 | ZeroMQ installed. If you are on Python 2.6 or 2.7 on OSX, or 2.7 on Windows, |
|
310 | ZeroMQ installed. If you are on Python 2.6 or 2.7 on OSX, or 2.7 on Windows, | |
311 | pyzmq has eggs that include ZeroMQ itself. |
|
311 | pyzmq has eggs that include ZeroMQ itself. | |
312 |
|
312 | |||
313 | IPython.kernel.zmq depends on pyzmq >= 2.1.4. |
|
313 | IPython.kernel.zmq depends on pyzmq >= 2.1.4. | |
314 |
|
314 | |||
315 | Dependencies for the IPython QT console |
|
315 | Dependencies for the IPython QT console | |
316 | ======================================= |
|
316 | ======================================= | |
317 |
|
317 | |||
318 | pyzmq |
|
318 | pyzmq | |
319 | ----- |
|
319 | ----- | |
320 |
|
320 | |||
321 | Like the :mod:`IPython.parallel` package, the QT Console requires ZeroMQ and |
|
321 | Like the :mod:`IPython.parallel` package, the QT Console requires ZeroMQ and | |
322 | PyZMQ. |
|
322 | PyZMQ. | |
323 |
|
323 | |||
324 | Qt |
|
324 | Qt | |
325 | -- |
|
325 | -- | |
326 |
|
326 | |||
327 | Also with 0.11, a new GUI was added using the work in :mod:`IPython.kernel.zmq`, which |
|
327 | Also with 0.11, a new GUI was added using the work in :mod:`IPython.kernel.zmq`, which | |
328 | can be launched with ``ipython qtconsole``. The GUI is built on Qt, and works |
|
328 | can be launched with ``ipython qtconsole``. The GUI is built on Qt, and works | |
329 | with either PyQt, which can be installed from the `PyQt website |
|
329 | with either PyQt, which can be installed from the `PyQt website | |
330 | <http://www.riverbankcomputing.co.uk/>`_, or `PySide |
|
330 | <http://www.riverbankcomputing.co.uk/>`_, or `PySide | |
331 | <http://www.pyside.org/>`_, from Nokia. |
|
331 | <http://www.pyside.org/>`_, from Nokia. | |
332 |
|
332 | |||
333 | pygments |
|
333 | pygments | |
334 | -------- |
|
334 | -------- | |
335 |
|
335 | |||
336 | The syntax-highlighting in ``ipython qtconsole`` is done with the pygments_ |
|
336 | The syntax-highlighting in ``ipython qtconsole`` is done with the pygments_ | |
337 | project, which is easy_install-able. |
|
337 | project, which is easy_install-able. | |
338 |
|
338 | |||
339 | .. _installnotebook: |
|
339 | .. _installnotebook: | |
340 |
|
340 | |||
341 | Dependencies for the IPython HTML notebook |
|
341 | Dependencies for the IPython HTML notebook | |
342 | ========================================== |
|
342 | ========================================== | |
343 |
|
343 | |||
344 | The IPython notebook is a notebook-style web interface to IPython and can be |
|
344 | The IPython notebook is a notebook-style web interface to IPython and can be | |
345 | started with the command ``ipython notebook``. |
|
345 | started with the command ``ipython notebook``. | |
346 |
|
346 | |||
347 | pyzmq |
|
347 | pyzmq | |
348 | ----- |
|
348 | ----- | |
349 |
|
349 | |||
350 | Like the :mod:`IPython.parallel` and :mod:`IPython.frontend.qt.console` |
|
350 | Like the :mod:`IPython.parallel` and :mod:`IPython.frontend.qt.console` | |
351 | packages, the HTML notebook requires ZeroMQ and PyZMQ. |
|
351 | packages, the HTML notebook requires ZeroMQ and PyZMQ. | |
352 |
|
352 | |||
353 | Tornado |
|
353 | Tornado | |
354 | ------- |
|
354 | ------- | |
355 |
|
355 | |||
356 | The IPython notebook uses the Tornado_ project for its HTTP server. Tornado 2.1 |
|
356 | The IPython notebook uses the Tornado_ project for its HTTP server. Tornado 2.1 | |
357 | is required, in order to support current versions of browsers, due to an update |
|
357 | is required, in order to support current versions of browsers, due to an update | |
358 | to the websocket protocol. |
|
358 | to the websocket protocol. | |
359 |
|
359 | |||
360 | Jinja |
|
360 | Jinja | |
361 | ----- |
|
361 | ----- | |
362 |
|
362 | |||
363 | The IPython notebook uses the Jinja_ templating tool to render HTML pages. |
|
363 | The IPython notebook uses the Jinja_ templating tool to render HTML pages. | |
364 |
|
364 | |||
365 |
|
365 | |||
366 | MathJax |
|
366 | MathJax | |
367 | ------- |
|
367 | ------- | |
368 |
|
368 | |||
369 | The IPython notebook uses the MathJax_ Javascript library for rendering LaTeX |
|
369 | The IPython notebook uses the MathJax_ Javascript library for rendering LaTeX | |
370 | in web browsers. Because MathJax is large, we don't include it with |
|
370 | in web browsers. Because MathJax is large, we don't include it with | |
371 | IPython. Normally IPython will load MathJax from a CDN, but if you have a slow |
|
371 | IPython. Normally IPython will load MathJax from a CDN, but if you have a slow | |
372 | network connection, or want to use LaTeX without an internet connection at all, |
|
372 | network connection, or want to use LaTeX without an internet connection at all, | |
373 | you can install MathJax locally. |
|
373 | you can install MathJax locally. | |
374 |
|
374 | |||
375 | A quick and easy method is to install it from a python session:: |
|
375 | A quick and easy method is to install it from a python session:: | |
376 |
|
376 | |||
377 | from IPython.external.mathjax import install_mathjax |
|
377 | from IPython.external.mathjax import install_mathjax | |
378 | install_mathjax() |
|
378 | install_mathjax() | |
379 |
|
379 | |||
380 | If you need tighter configuration control, you can download your own copy |
|
380 | If you need tighter configuration control, you can download your own copy | |
381 | of MathJax from http://www.mathjax.org/download/ - use the MathJax-2.0 link. |
|
381 | of MathJax from http://www.mathjax.org/download/ - use the MathJax-2.0 link. | |
382 | When you have the file stored locally, install it with:: |
|
382 | When you have the file stored locally, install it with:: | |
383 |
|
383 | |||
384 | python -m IPython.external.mathjax /path/to/source/mathjax-MathJax-v2.0-20-g07669ac.zip |
|
384 | python -m IPython.external.mathjax /path/to/source/mathjax-MathJax-v2.0-20-g07669ac.zip | |
385 |
|
385 | |||
386 | For unusual needs, IPython can tell you what directory it wants to find MathJax in:: |
|
386 | For unusual needs, IPython can tell you what directory it wants to find MathJax in:: | |
387 |
|
387 | |||
388 | python -m IPython.external.mathjax -d /some/other/mathjax |
|
388 | python -m IPython.external.mathjax -d /some/other/mathjax | |
389 |
|
389 | |||
390 | By default Mathjax will be installed in your ipython profile directory, but you |
|
390 | By default Mathjax will be installed in your ipython profile directory, but you | |
391 | can make system wide install, please refer to the documentation and helper function |
|
391 | can make system wide install, please refer to the documentation and helper function | |
392 | of :mod:`IPython.external.mathjax` |
|
392 | of :mod:`IPython.external.mathjax` | |
393 |
|
393 | |||
394 | Browser Compatibility |
|
394 | Browser Compatibility | |
395 | --------------------- |
|
395 | --------------------- | |
396 |
|
396 | |||
397 | The IPython notebook is officially supported on the following browers: |
|
397 | The IPython notebook is officially supported on the following browers: | |
398 |
|
398 | |||
399 | * Chrome ≥ 13 |
|
399 | * Chrome ≥ 13 | |
400 | * Safari ≥ 5 |
|
400 | * Safari ≥ 5 | |
401 | * Firefox ≥ 6 |
|
401 | * Firefox ≥ 6 | |
402 |
|
402 | |||
403 | The is mainly due to the notebook's usage of WebSockets and the flexible box model. |
|
403 | The is mainly due to the notebook's usage of WebSockets and the flexible box model. | |
404 |
|
404 | |||
405 | The following browsers are unsupported: |
|
405 | The following browsers are unsupported: | |
406 |
|
406 | |||
407 | * Safari < 5 |
|
407 | * Safari < 5 | |
408 | * Firefox < 6 |
|
408 | * Firefox < 6 | |
409 | * Chrome < 13 |
|
409 | * Chrome < 13 | |
410 | * Opera (any): CSS issues, but execution might work |
|
410 | * Opera (any): CSS issues, but execution might work | |
411 | * Internet Explorer < 10 |
|
411 | * Internet Explorer < 10 | |
412 |
|
412 | |||
413 | The following specific combinations are known **NOT** to work: |
|
413 | The following specific combinations are known **NOT** to work: | |
414 |
|
414 | |||
415 | * Safari, IPython 0.12, tornado ≥ 2.2.0 |
|
415 | * Safari, IPython 0.12, tornado ≥ 2.2.0 | |
416 | * Safari with HTTPS connection to notebook and an untrusted certificate (websockets will fail) |
|
416 | * Safari with HTTPS connection to notebook and an untrusted certificate (websockets will fail) | |
417 | * The [diigo Chrome extension](http://help.diigo.com/tools/chrome-extension) seems to interfere with scrolling |
|
417 | * The [diigo Chrome extension](http://help.diigo.com/tools/chrome-extension) seems to interfere with scrolling | |
418 |
|
418 | |||
419 | There are some early reports that the Notebook works on Internet Explorer 10, but we |
|
419 | There are some early reports that the Notebook works on Internet Explorer 10, but we | |
420 | expect there will be some CSS issues related to the flexible box model. |
|
420 | expect there will be some CSS issues related to the flexible box model. | |
421 |
|
421 | |||
422 |
|
422 | |||
423 | Dependencies for nbconvert (converting notebooks to various formats) |
|
423 | Dependencies for nbconvert (converting notebooks to various formats) | |
424 | ==================================================================== |
|
424 | ==================================================================== | |
425 |
|
425 | |||
426 | pandoc |
|
426 | pandoc | |
427 | ------ |
|
427 | ------ | |
428 |
|
428 | |||
429 | The most important dependency of nbconvert is Pandoc_, a document format translation program. |
|
429 | The most important dependency of nbconvert is Pandoc_, a document format translation program. | |
430 | This is not a Python package, so it cannot be expressed as a regular IPython dependency with setuptools. |
|
430 | This is not a Python package, so it cannot be expressed as a regular IPython dependency with setuptools. | |
431 |
|
431 | |||
432 | To install pandoc on Linux, you can generally use your package manager:: |
|
432 | To install pandoc on Linux, you can generally use your package manager:: | |
433 |
|
433 | |||
434 | sudo apt-get install pandoc |
|
434 | sudo apt-get install pandoc | |
435 |
|
435 | |||
436 | On other platforms, you can get pandoc from `their website <http://johnmacfarlane.net/pandoc/installing.html>`_. |
|
436 | On other platforms, you can get pandoc from `their website <http://johnmacfarlane.net/pandoc/installing.html>`_. | |
437 |
|
437 | |||
438 |
|
438 | |||
439 | .. _ZeroMQ: http://www.zeromq.org |
|
439 | .. _ZeroMQ: http://www.zeromq.org | |
440 | .. _PyZMQ: https://github.com/zeromq/pyzmq |
|
440 | .. _PyZMQ: https://github.com/zeromq/pyzmq | |
441 | .. _paramiko: https://github.com/robey/paramiko |
|
441 | .. _paramiko: https://github.com/robey/paramiko | |
442 | .. _pygments: http://pygments.org |
|
442 | .. _pygments: http://pygments.org | |
443 | .. _pexpect: http://www.noah.org/wiki/Pexpect |
|
443 | .. _pexpect: http://www.noah.org/wiki/Pexpect | |
444 | .. _Jinja: http://jinja.pocoo.org |
|
444 | .. _Jinja: http://jinja.pocoo.org | |
445 | .. _Sphinx: http://sphinx-doc.org |
|
445 | .. _Sphinx: http://sphinx-doc.org | |
446 | .. _pandoc: http://johnmacfarlane.net/pandoc |
|
446 | .. _pandoc: http://johnmacfarlane.net/pandoc | |
447 | .. _Tornado: http://www.tornadoweb.org |
|
447 | .. _Tornado: http://www.tornadoweb.org | |
448 | .. _MathJax: http://www.mathjax.org |
|
448 | .. _MathJax: http://www.mathjax.org |
@@ -1,290 +1,289 b'' | |||||
1 | .. _overview: |
|
1 | .. _overview: | |
2 |
|
2 | |||
3 | ============ |
|
3 | ============ | |
4 | Introduction |
|
4 | Introduction | |
5 | ============ |
|
5 | ============ | |
6 |
|
6 | |||
7 | Overview |
|
7 | Overview | |
8 | ======== |
|
8 | ======== | |
9 |
|
9 | |||
10 | One of Python's most useful features is its interactive interpreter. |
|
10 | One of Python's most useful features is its interactive interpreter. | |
11 | It allows for very fast testing of ideas without the overhead of |
|
11 | It allows for very fast testing of ideas without the overhead of | |
12 | creating test files as is typical in most programming languages. |
|
12 | creating test files as is typical in most programming languages. | |
13 | However, the interpreter supplied with the standard Python distribution |
|
13 | However, the interpreter supplied with the standard Python distribution | |
14 | is somewhat limited for extended interactive use. |
|
14 | is somewhat limited for extended interactive use. | |
15 |
|
15 | |||
16 | The goal of IPython is to create a comprehensive environment for |
|
16 | The goal of IPython is to create a comprehensive environment for | |
17 | interactive and exploratory computing. To support this goal, IPython |
|
17 | interactive and exploratory computing. To support this goal, IPython | |
18 | has three main components: |
|
18 | has three main components: | |
19 |
|
19 | |||
20 | * An enhanced interactive Python shell. |
|
20 | * An enhanced interactive Python shell. | |
21 | * A decoupled :ref:`two-process communication model <ipythonzmq>`, which |
|
21 | * A decoupled :ref:`two-process communication model <ipythonzmq>`, which | |
22 | allows for multiple clients to connect to a computation kernel, most notably |
|
22 | allows for multiple clients to connect to a computation kernel, most notably | |
23 | the web-based :ref:`notebook <htmlnotebook>` |
|
23 | the web-based :ref:`notebook <htmlnotebook>` | |
24 | * An architecture for interactive parallel computing. |
|
24 | * An architecture for interactive parallel computing. | |
25 |
|
25 | |||
26 | All of IPython is open source (released under the revised BSD license). |
|
26 | All of IPython is open source (released under the revised BSD license). | |
27 |
|
27 | |||
28 | Enhanced interactive Python shell |
|
28 | Enhanced interactive Python shell | |
29 | ================================= |
|
29 | ================================= | |
30 |
|
30 | |||
31 | IPython's interactive shell (:command:`ipython`), has the following goals, |
|
31 | IPython's interactive shell (:command:`ipython`), has the following goals, | |
32 | amongst others: |
|
32 | amongst others: | |
33 |
|
33 | |||
34 | 1. Provide an interactive shell superior to Python's default. IPython |
|
34 | 1. Provide an interactive shell superior to Python's default. IPython | |
35 | has many features for tab-completion, object introspection, system shell |
|
35 | has many features for tab-completion, object introspection, system shell | |
36 | access, command history retrieval across sessions, and its own special |
|
36 | access, command history retrieval across sessions, and its own special | |
37 | command system for adding functionality when working interactively. It |
|
37 | command system for adding functionality when working interactively. It | |
38 | tries to be a very efficient environment both for Python code development |
|
38 | tries to be a very efficient environment both for Python code development | |
39 | and for exploration of problems using Python objects (in situations like |
|
39 | and for exploration of problems using Python objects (in situations like | |
40 | data analysis). |
|
40 | data analysis). | |
41 |
|
41 | |||
42 | 2. Serve as an embeddable, ready to use interpreter for your own |
|
42 | 2. Serve as an embeddable, ready to use interpreter for your own | |
43 | programs. An interactive IPython shell can be started with a single call |
|
43 | programs. An interactive IPython shell can be started with a single call | |
44 | from inside another program, providing access to the current namespace. |
|
44 | from inside another program, providing access to the current namespace. | |
45 | This can be very useful both for debugging purposes and for situations |
|
45 | This can be very useful both for debugging purposes and for situations | |
46 | where a blend of batch-processing and interactive exploration are needed. |
|
46 | where a blend of batch-processing and interactive exploration are needed. | |
47 |
|
47 | |||
48 | 3. Offer a flexible framework which can be used as the base |
|
48 | 3. Offer a flexible framework which can be used as the base | |
49 | environment for working with other systems, with Python as the underlying |
|
49 | environment for working with other systems, with Python as the underlying | |
50 | bridge language. Specifically scientific environments like Mathematica, |
|
50 | bridge language. Specifically scientific environments like Mathematica, | |
51 | IDL and Matlab inspired its design, but similar ideas can be |
|
51 | IDL and Matlab inspired its design, but similar ideas can be | |
52 | useful in many fields. |
|
52 | useful in many fields. | |
53 |
|
53 | |||
54 | 4. Allow interactive testing of threaded graphical toolkits. IPython |
|
54 | 4. Allow interactive testing of threaded graphical toolkits. IPython | |
55 | has support for interactive, non-blocking control of GTK, Qt, WX, GLUT, and |
|
55 | has support for interactive, non-blocking control of GTK, Qt, WX, GLUT, and | |
56 | OS X applications via special threading flags. The normal Python |
|
56 | OS X applications via special threading flags. The normal Python | |
57 | shell can only do this for Tkinter applications. |
|
57 | shell can only do this for Tkinter applications. | |
58 |
|
58 | |||
59 | Main features of the interactive shell |
|
59 | Main features of the interactive shell | |
60 | -------------------------------------- |
|
60 | -------------------------------------- | |
61 |
|
61 | |||
62 | * Dynamic object introspection. One can access docstrings, function |
|
62 | * Dynamic object introspection. One can access docstrings, function | |
63 | definition prototypes, source code, source files and other details |
|
63 | definition prototypes, source code, source files and other details | |
64 | of any object accessible to the interpreter with a single |
|
64 | of any object accessible to the interpreter with a single | |
65 | keystroke (:samp:`?`, and using :samp:`??` provides additional detail). |
|
65 | keystroke (:samp:`?`, and using :samp:`??` provides additional detail). | |
66 |
|
66 | |||
67 | * Searching through modules and namespaces with :samp:`*` wildcards, both |
|
67 | * Searching through modules and namespaces with :samp:`*` wildcards, both | |
68 | when using the :samp:`?` system and via the :samp:`%psearch` command. |
|
68 | when using the :samp:`?` system and via the :samp:`%psearch` command. | |
69 |
|
69 | |||
70 | * Completion in the local namespace, by typing :kbd:`TAB` at the prompt. |
|
70 | * Completion in the local namespace, by typing :kbd:`TAB` at the prompt. | |
71 | This works for keywords, modules, methods, variables and files in the |
|
71 | This works for keywords, modules, methods, variables and files in the | |
72 | current directory. This is supported via the readline library, and |
|
72 | current directory. This is supported via the readline library, and | |
73 | full access to configuring readline's behavior is provided. |
|
73 | full access to configuring readline's behavior is provided. | |
74 | Custom completers can be implemented easily for different purposes |
|
74 | Custom completers can be implemented easily for different purposes | |
75 | (system commands, magic arguments etc.) |
|
75 | (system commands, magic arguments etc.) | |
76 |
|
76 | |||
77 | * Numbered input/output prompts with command history (persistent |
|
77 | * Numbered input/output prompts with command history (persistent | |
78 | across sessions and tied to each profile), full searching in this |
|
78 | across sessions and tied to each profile), full searching in this | |
79 | history and caching of all input and output. |
|
79 | history and caching of all input and output. | |
80 |
|
80 | |||
81 | * User-extensible 'magic' commands. A set of commands prefixed with |
|
81 | * User-extensible 'magic' commands. A set of commands prefixed with | |
82 | :samp:`%` is available for controlling IPython itself and provides |
|
82 | :samp:`%` is available for controlling IPython itself and provides | |
83 | directory control, namespace information and many aliases to |
|
83 | directory control, namespace information and many aliases to | |
84 | common system shell commands. |
|
84 | common system shell commands. | |
85 |
|
85 | |||
86 | * Alias facility for defining your own system aliases. |
|
86 | * Alias facility for defining your own system aliases. | |
87 |
|
87 | |||
88 | * Complete system shell access. Lines starting with :samp:`!` are passed |
|
88 | * Complete system shell access. Lines starting with :samp:`!` are passed | |
89 | directly to the system shell, and using :samp:`!!` or :samp:`var = !cmd` |
|
89 | directly to the system shell, and using :samp:`!!` or :samp:`var = !cmd` | |
90 | captures shell output into python variables for further use. |
|
90 | captures shell output into python variables for further use. | |
91 |
|
91 | |||
92 | * The ability to expand python variables when calling the system shell. In a |
|
92 | * The ability to expand python variables when calling the system shell. In a | |
93 | shell command, any python variable prefixed with :samp:`$` is expanded. A |
|
93 | shell command, any python variable prefixed with :samp:`$` is expanded. A | |
94 | double :samp:`$$` allows passing a literal :samp:`$` to the shell (for access |
|
94 | double :samp:`$$` allows passing a literal :samp:`$` to the shell (for access | |
95 | to shell and environment variables like :envvar:`PATH`). |
|
95 | to shell and environment variables like :envvar:`PATH`). | |
96 |
|
96 | |||
97 | * Filesystem navigation, via a magic :samp:`%cd` command, along with a |
|
97 | * Filesystem navigation, via a magic :samp:`%cd` command, along with a | |
98 | persistent bookmark system (using :samp:`%bookmark`) for fast access to |
|
98 | persistent bookmark system (using :samp:`%bookmark`) for fast access to | |
99 | frequently visited directories. |
|
99 | frequently visited directories. | |
100 |
|
100 | |||
101 | * A lightweight persistence framework via the :samp:`%store` command, which |
|
101 | * A lightweight persistence framework via the :samp:`%store` command, which | |
102 | allows you to save arbitrary Python variables. These get restored |
|
102 | allows you to save arbitrary Python variables. These get restored | |
103 | when you run the :samp:`%store -r` command. |
|
103 | when you run the :samp:`%store -r` command. | |
104 |
|
104 | |||
105 | * Automatic indentation (optional) of code as you type (through the |
|
105 | * Automatic indentation (optional) of code as you type (through the | |
106 | readline library). |
|
106 | readline library). | |
107 |
|
107 | |||
108 | * Macro system for quickly re-executing multiple lines of previous |
|
108 | * Macro system for quickly re-executing multiple lines of previous | |
109 | input with a single name via the :samp:`%macro` command. Macros can be |
|
109 | input with a single name via the :samp:`%macro` command. Macros can be | |
110 | stored persistently via :samp:`%store` and edited via :samp:`%edit`. |
|
110 | stored persistently via :samp:`%store` and edited via :samp:`%edit`. | |
111 |
|
111 | |||
112 | * Session logging (you can then later use these logs as code in your |
|
112 | * Session logging (you can then later use these logs as code in your | |
113 | programs). Logs can optionally timestamp all input, and also store |
|
113 | programs). Logs can optionally timestamp all input, and also store | |
114 | session output (marked as comments, so the log remains valid |
|
114 | session output (marked as comments, so the log remains valid | |
115 | Python source code). |
|
115 | Python source code). | |
116 |
|
116 | |||
117 | * Session restoring: logs can be replayed to restore a previous |
|
117 | * Session restoring: logs can be replayed to restore a previous | |
118 | session to the state where you left it. |
|
118 | session to the state where you left it. | |
119 |
|
119 | |||
120 | * Verbose and colored exception traceback printouts. Easier to parse |
|
120 | * Verbose and colored exception traceback printouts. Easier to parse | |
121 | visually, and in verbose mode they produce a lot of useful |
|
121 | visually, and in verbose mode they produce a lot of useful | |
122 | debugging information (basically a terminal version of the cgitb |
|
122 | debugging information (basically a terminal version of the cgitb | |
123 | module). |
|
123 | module). | |
124 |
|
124 | |||
125 | * Auto-parentheses via the :samp:`%autocall` command: callable objects can be |
|
125 | * Auto-parentheses via the :samp:`%autocall` command: callable objects can be | |
126 | executed without parentheses: :samp:`sin 3` is automatically converted to |
|
126 | executed without parentheses: :samp:`sin 3` is automatically converted to | |
127 | :samp:`sin(3)` |
|
127 | :samp:`sin(3)` | |
128 |
|
128 | |||
129 | * Auto-quoting: using :samp:`,`, or :samp:`;` as the first character forces |
|
129 | * Auto-quoting: using :samp:`,`, or :samp:`;` as the first character forces | |
130 | auto-quoting of the rest of the line: :samp:`,my_function a b` becomes |
|
130 | auto-quoting of the rest of the line: :samp:`,my_function a b` becomes | |
131 | automatically :samp:`my_function("a","b")`, while :samp:`;my_function a b` |
|
131 | automatically :samp:`my_function("a","b")`, while :samp:`;my_function a b` | |
132 | becomes :samp:`my_function("a b")`. |
|
132 | becomes :samp:`my_function("a b")`. | |
133 |
|
133 | |||
134 | * Extensible input syntax. You can define filters that pre-process |
|
134 | * Extensible input syntax. You can define filters that pre-process | |
135 | user input to simplify input in special situations. This allows |
|
135 | user input to simplify input in special situations. This allows | |
136 | for example pasting multi-line code fragments which start with |
|
136 | for example pasting multi-line code fragments which start with | |
137 | :samp:`>>>` or :samp:`...` such as those from other python sessions or the |
|
137 | :samp:`>>>` or :samp:`...` such as those from other python sessions or the | |
138 | standard Python documentation. |
|
138 | standard Python documentation. | |
139 |
|
139 | |||
140 | * Flexible :ref:`configuration system <config_overview>`. It uses a |
|
140 | * Flexible :ref:`configuration system <config_overview>`. It uses a | |
141 | configuration file which allows permanent setting of all command-line |
|
141 | configuration file which allows permanent setting of all command-line | |
142 | options, module loading, code and file execution. The system allows |
|
142 | options, module loading, code and file execution. The system allows | |
143 | recursive file inclusion, so you can have a base file with defaults and |
|
143 | recursive file inclusion, so you can have a base file with defaults and | |
144 | layers which load other customizations for particular projects. |
|
144 | layers which load other customizations for particular projects. | |
145 |
|
145 | |||
146 | * Embeddable. You can call IPython as a python shell inside your own |
|
146 | * Embeddable. You can call IPython as a python shell inside your own | |
147 | python programs. This can be used both for debugging code or for |
|
147 | python programs. This can be used both for debugging code or for | |
148 | providing interactive abilities to your programs with knowledge |
|
148 | providing interactive abilities to your programs with knowledge | |
149 | about the local namespaces (very useful in debugging and data |
|
149 | about the local namespaces (very useful in debugging and data | |
150 | analysis situations). |
|
150 | analysis situations). | |
151 |
|
151 | |||
152 | * Easy debugger access. You can set IPython to call up an enhanced version of |
|
152 | * Easy debugger access. You can set IPython to call up an enhanced version of | |
153 | the Python debugger (pdb) every time there is an uncaught exception. This |
|
153 | the Python debugger (pdb) every time there is an uncaught exception. This | |
154 | drops you inside the code which triggered the exception with all the data |
|
154 | drops you inside the code which triggered the exception with all the data | |
155 | live and it is possible to navigate the stack to rapidly isolate the source |
|
155 | live and it is possible to navigate the stack to rapidly isolate the source | |
156 | of a bug. The :samp:`%run` magic command (with the :samp:`-d` option) can run |
|
156 | of a bug. The :samp:`%run` magic command (with the :samp:`-d` option) can run | |
157 | any script under pdb's control, automatically setting initial breakpoints for |
|
157 | any script under pdb's control, automatically setting initial breakpoints for | |
158 | you. This version of pdb has IPython-specific improvements, including |
|
158 | you. This version of pdb has IPython-specific improvements, including | |
159 | tab-completion and traceback coloring support. For even easier debugger |
|
159 | tab-completion and traceback coloring support. For even easier debugger | |
160 | access, try :samp:`%debug` after seeing an exception. |
|
160 | access, try :samp:`%debug` after seeing an exception. | |
161 |
|
161 | |||
162 | * Profiler support. You can run single statements (similar to |
|
162 | * Profiler support. You can run single statements (similar to | |
163 | :samp:`profile.run()`) or complete programs under the profiler's control. |
|
163 | :samp:`profile.run()`) or complete programs under the profiler's control. | |
164 | While this is possible with standard cProfile or profile modules, |
|
164 | While this is possible with standard cProfile or profile modules, | |
165 | IPython wraps this functionality with magic commands (see :samp:`%prun` |
|
165 | IPython wraps this functionality with magic commands (see :samp:`%prun` | |
166 | and :samp:`%run -p`) convenient for rapid interactive work. |
|
166 | and :samp:`%run -p`) convenient for rapid interactive work. | |
167 |
|
167 | |||
168 | * Simple timing information. You can use the :samp:`%timeit` command to get |
|
168 | * Simple timing information. You can use the :samp:`%timeit` command to get | |
169 | the execution time of a Python statement or expression. This machinery is |
|
169 | the execution time of a Python statement or expression. This machinery is | |
170 | intelligent enough to do more repetitions for commands that finish very |
|
170 | intelligent enough to do more repetitions for commands that finish very | |
171 | quickly in order to get a better estimate of their running time. |
|
171 | quickly in order to get a better estimate of their running time. | |
172 |
|
172 | |||
173 | .. sourcecode:: ipython |
|
173 | .. sourcecode:: ipython | |
174 |
|
174 | |||
175 | In [1]: %timeit 1+1 |
|
175 | In [1]: %timeit 1+1 | |
176 | 10000000 loops, best of 3: 25.5 ns per loop |
|
176 | 10000000 loops, best of 3: 25.5 ns per loop | |
177 |
|
177 | |||
178 | In [2]: %timeit [math.sin(x) for x in range(5000)] |
|
178 | In [2]: %timeit [math.sin(x) for x in range(5000)] | |
179 | 1000 loops, best of 3: 719 µs per loop |
|
179 | 1000 loops, best of 3: 719 µs per loop | |
180 |
|
180 | |||
181 | .. |
|
181 | .. | |
182 |
|
182 | |||
183 | To get the timing information for more than one expression, use the |
|
183 | To get the timing information for more than one expression, use the | |
184 | :samp:`%%timeit` cell magic command. |
|
184 | :samp:`%%timeit` cell magic command. | |
185 |
|
185 | |||
186 |
|
186 | |||
187 | * Doctest support. The special :samp:`%doctest_mode` command toggles a mode |
|
187 | * Doctest support. The special :samp:`%doctest_mode` command toggles a mode | |
188 | to use doctest-compatible prompts, so you can use IPython sessions as |
|
188 | to use doctest-compatible prompts, so you can use IPython sessions as | |
189 | doctest code. By default, IPython also allows you to paste existing |
|
189 | doctest code. By default, IPython also allows you to paste existing | |
190 | doctests, and strips out the leading :samp:`>>>` and :samp:`...` prompts in |
|
190 | doctests, and strips out the leading :samp:`>>>` and :samp:`...` prompts in | |
191 | them. |
|
191 | them. | |
192 |
|
192 | |||
193 | .. _ipythonzmq: |
|
193 | .. _ipythonzmq: | |
194 |
|
194 | |||
195 | Decoupled two-process model |
|
195 | Decoupled two-process model | |
196 | ============================== |
|
196 | ============================== | |
197 |
|
197 | |||
198 | IPython has abstracted and extended the notion of a traditional |
|
198 | IPython has abstracted and extended the notion of a traditional | |
199 | *Read-Evaluate-Print Loop* (REPL) environment by decoupling the *evaluation* |
|
199 | *Read-Evaluate-Print Loop* (REPL) environment by decoupling the *evaluation* | |
200 | into its own process. We call this process a **kernel**: it receives execution |
|
200 | into its own process. We call this process a **kernel**: it receives execution | |
201 | instructions from clients and communicates the results back to them. |
|
201 | instructions from clients and communicates the results back to them. | |
202 |
|
202 | |||
203 | This decoupling allows us to have several clients connected to the same |
|
203 | This decoupling allows us to have several clients connected to the same | |
204 | kernel, and even allows clients and kernels to live on different machines. |
|
204 | kernel, and even allows clients and kernels to live on different machines. | |
205 | With the exclusion of the traditional single process terminal-based IPython |
|
205 | With the exclusion of the traditional single process terminal-based IPython | |
206 | (what you start if you run ``ipython`` without any subcommands), all |
|
206 | (what you start if you run ``ipython`` without any subcommands), all | |
207 | other IPython machinery uses this two-process model. This includes ``ipython |
|
207 | other IPython machinery uses this two-process model. This includes ``ipython | |
208 | console``, ``ipython qtconsole``, and ``ipython notebook``. |
|
208 | console``, ``ipython qtconsole``, and ``ipython notebook``. | |
209 |
|
209 | |||
210 | As an example, this means that when you start ``ipython qtconsole``, you're |
|
210 | As an example, this means that when you start ``ipython qtconsole``, you're | |
211 | really starting two processes, a kernel and a Qt-based client can send |
|
211 | really starting two processes, a kernel and a Qt-based client can send | |
212 | commands to and receive results from that kernel. If there is already a kernel |
|
212 | commands to and receive results from that kernel. If there is already a kernel | |
213 | running that you want to connect to, you can pass the ``--existing`` flag |
|
213 | running that you want to connect to, you can pass the ``--existing`` flag | |
214 | which will skip initiating a new kernel and connect to the most recent kernel, |
|
214 | which will skip initiating a new kernel and connect to the most recent kernel, | |
215 | instead. To connect to a specific kernel once you have several kernels |
|
215 | instead. To connect to a specific kernel once you have several kernels | |
216 | running, use the ``%connect_info`` magic to get the unique connection file, |
|
216 | running, use the ``%connect_info`` magic to get the unique connection file, | |
217 | which will be something like ``--existing kernel-19732.json`` but with |
|
217 | which will be something like ``--existing kernel-19732.json`` but with | |
218 | different numbers which correspond to the Process ID of the kernel. |
|
218 | different numbers which correspond to the Process ID of the kernel. | |
219 |
|
219 | |||
220 | You can read more about using :ref:`ipython qtconsole <qtconsole>`, and |
|
220 | You can read more about using :ref:`ipython qtconsole <qtconsole>`, and | |
221 | :ref:`ipython notebook <htmlnotebook>`. There is also a :ref:`message spec |
|
221 | :ref:`ipython notebook <htmlnotebook>`. There is also a :ref:`message spec | |
222 | <messaging>` which documents the protocol for communication between kernels |
|
222 | <messaging>` which documents the protocol for communication between kernels | |
223 | and clients. |
|
223 | and clients. | |
224 |
|
224 | |||
225 | .. seealso:: |
|
225 | .. seealso:: | |
226 |
|
226 | |||
227 | `Frontend/Kernel Model`_ example notebook |
|
227 | `Frontend/Kernel Model`_ example notebook | |
228 |
|
228 | |||
229 |
|
229 | |||
230 | Interactive parallel computing |
|
230 | Interactive parallel computing | |
231 | ============================== |
|
231 | ============================== | |
232 |
|
232 | |||
233 | Increasingly, parallel computer hardware, such as multicore CPUs, clusters and |
|
233 | Increasingly, parallel computer hardware, such as multicore CPUs, clusters and | |
234 | supercomputers, is becoming ubiquitous. Over the last several years, we have |
|
234 | supercomputers, is becoming ubiquitous. Over the last several years, we have | |
235 | developed an architecture within IPython that allows such hardware to be used |
|
235 | developed an architecture within IPython that allows such hardware to be used | |
236 | quickly and easily from Python. Moreover, this architecture is designed to |
|
236 | quickly and easily from Python. Moreover, this architecture is designed to | |
237 | support interactive and collaborative parallel computing. |
|
237 | support interactive and collaborative parallel computing. | |
238 |
|
238 | |||
239 | The main features of this system are: |
|
239 | The main features of this system are: | |
240 |
|
240 | |||
241 | * Quickly parallelize Python code from an interactive Python/IPython session. |
|
241 | * Quickly parallelize Python code from an interactive Python/IPython session. | |
242 |
|
242 | |||
243 | * A flexible and dynamic process model that be deployed on anything from |
|
243 | * A flexible and dynamic process model that be deployed on anything from | |
244 | multicore workstations to supercomputers. |
|
244 | multicore workstations to supercomputers. | |
245 |
|
245 | |||
246 | * An architecture that supports many different styles of parallelism, from |
|
246 | * An architecture that supports many different styles of parallelism, from | |
247 | message passing to task farming. And all of these styles can be handled |
|
247 | message passing to task farming. And all of these styles can be handled | |
248 | interactively. |
|
248 | interactively. | |
249 |
|
249 | |||
250 | * Both blocking and fully asynchronous interfaces. |
|
250 | * Both blocking and fully asynchronous interfaces. | |
251 |
|
251 | |||
252 | * High level APIs that enable many things to be parallelized in a few lines |
|
252 | * High level APIs that enable many things to be parallelized in a few lines | |
253 | of code. |
|
253 | of code. | |
254 |
|
254 | |||
255 | * Write parallel code that will run unchanged on everything from multicore |
|
255 | * Write parallel code that will run unchanged on everything from multicore | |
256 | workstations to supercomputers. |
|
256 | workstations to supercomputers. | |
257 |
|
257 | |||
258 | * Full integration with Message Passing libraries (MPI). |
|
258 | * Full integration with Message Passing libraries (MPI). | |
259 |
|
259 | |||
260 | * Capabilities based security model with full encryption of network connections. |
|
260 | * Capabilities based security model with full encryption of network connections. | |
261 |
|
261 | |||
262 | * Share live parallel jobs with other users securely. We call this |
|
262 | * Share live parallel jobs with other users securely. We call this | |
263 | collaborative parallel computing. |
|
263 | collaborative parallel computing. | |
264 |
|
264 | |||
265 | * Dynamically load balanced task farming system. |
|
265 | * Dynamically load balanced task farming system. | |
266 |
|
266 | |||
267 | * Robust error handling. Python exceptions raised in parallel execution are |
|
267 | * Robust error handling. Python exceptions raised in parallel execution are | |
268 | gathered and presented to the top-level code. |
|
268 | gathered and presented to the top-level code. | |
269 |
|
269 | |||
270 | For more information, see our :ref:`overview <parallel_index>` of using IPython |
|
270 | For more information, see our :ref:`overview <parallel_index>` of using IPython | |
271 | for parallel computing. |
|
271 | for parallel computing. | |
272 |
|
272 | |||
273 | Portability and Python requirements |
|
273 | Portability and Python requirements | |
274 | ----------------------------------- |
|
274 | ----------------------------------- | |
275 |
|
275 | |||
276 |
As of the |
|
276 | As of the 2.0 release, IPython works with Python 2.7 and 3.3 or above. | |
277 | Version 0.12 introduced full support for Python 3. Version 0.11 worked with |
|
277 | Version 1.0 additionally worked with Python 2.6 and 3.2. | |
278 | Python 2.6 and 2.7 only. Versions 0.9 and 0.10 worked with Python 2.4 and |
|
278 | Version 0.12 was the first version to fully support Python 3. | |
279 | above (not including Python 3). |
|
|||
280 |
|
279 | |||
281 | IPython is known to work on the following operating systems: |
|
280 | IPython is known to work on the following operating systems: | |
282 |
|
281 | |||
283 | * Linux |
|
282 | * Linux | |
284 | * Most other Unix-like OSs (AIX, Solaris, BSD, etc.) |
|
283 | * Most other Unix-like OSs (AIX, Solaris, BSD, etc.) | |
285 | * Mac OS X |
|
284 | * Mac OS X | |
286 | * Windows (CygWin, XP, Vista, etc.) |
|
285 | * Windows (CygWin, XP, Vista, etc.) | |
287 |
|
286 | |||
288 | See :ref:`here <install_index>` for instructions on how to install IPython. |
|
287 | See :ref:`here <install_index>` for instructions on how to install IPython. | |
289 |
|
288 | |||
290 | .. include:: links.txt |
|
289 | .. include:: links.txt |
@@ -1,10 +1,12 b'' | |||||
1 | ===================== |
|
1 | ===================== | |
2 | Development version |
|
2 | Development version | |
3 | ===================== |
|
3 | ===================== | |
4 |
|
4 | |||
5 | This document describes in-flight development work. |
|
5 | This document describes in-flight development work. | |
6 |
|
6 | |||
7 |
|
7 | |||
8 | Backwards incompatible changes |
|
8 | Backwards incompatible changes | |
9 | ------------------------------ |
|
9 | ------------------------------ | |
10 |
|
10 | |||
|
11 | * Python 2.6 and 3.2 are no longer supported: the minimum required | |||
|
12 | Python versions are now 2.7 and 3.3. |
General Comments 0
You need to be logged in to leave comments.
Login now