##// END OF EJS Templates
updated installation instructions for OS X 10.5 (including readline egg and SVN 1.5 patch instructions from wiki http://ipython.scipy.org/moin/InstallationOSXLeopard
Barry Wark -
Show More
@@ -1,272 +1,286 b''
1 =============================
1 =============================
2 Basic installation of IPython
2 Basic installation of IPython
3 =============================
3 =============================
4
4
5 Installation
5 Installation
6 ============
6 ============
7
7
8 Instant instructions
8 Instant instructions
9 --------------------
9 --------------------
10
10
11 If you are of the impatient kind, under Linux/Unix simply untar/unzip
11 If you are of the impatient kind, under Linux/Unix simply untar/unzip
12 the download, then install with 'python setup.py install'. Under
12 the download, then install with 'python setup.py install'. Under
13 Windows, double-click on the provided .exe binary installer.
13 Windows, double-click on the provided .exe binary installer.
14
14
15 Then, take a look at Customization_ section for configuring things
15 Then, take a look at Customization_ section for configuring things
16 optimally and `Quick tips`_ for quick tips on efficient use of
16 optimally and `Quick tips`_ for quick tips on efficient use of
17 IPython. You can later refer to the rest of the manual for all the
17 IPython. You can later refer to the rest of the manual for all the
18 gory details.
18 gory details.
19
19
20 See the notes in upgrading_ section for upgrading IPython versions.
20 See the notes in upgrading_ section for upgrading IPython versions.
21
21
22
22
23 Detailed Unix instructions (Linux, Mac OS X, etc.)
23 Detailed Unix instructions (Linux, Mac OS X, etc.)
24
24
25 For RPM based systems, simply install the supplied package in the usual
25 For RPM based systems, simply install the supplied package in the usual
26 manner. If you download the tar archive, the process is:
26 manner. If you download the tar archive, the process is:
27
27
28 1. Unzip/untar the ipython-XXX.tar.gz file wherever you want (XXX is
28 1. Unzip/untar the ipython-XXX.tar.gz file wherever you want (XXX is
29 the version number). It will make a directory called ipython-XXX.
29 the version number). It will make a directory called ipython-XXX.
30 Change into that directory where you will find the files README
30 Change into that directory where you will find the files README
31 and setup.py. Once you've completed the installation, you can
31 and setup.py. Once you've completed the installation, you can
32 safely remove this directory.
32 safely remove this directory.
33 2. If you are installing over a previous installation of version
33 2. If you are installing over a previous installation of version
34 0.2.0 or earlier, first remove your $HOME/.ipython directory,
34 0.2.0 or earlier, first remove your $HOME/.ipython directory,
35 since the configuration file format has changed somewhat (the '='
35 since the configuration file format has changed somewhat (the '='
36 were removed from all option specifications). Or you can call
36 were removed from all option specifications). Or you can call
37 ipython with the -upgrade option and it will do this automatically
37 ipython with the -upgrade option and it will do this automatically
38 for you.
38 for you.
39 3. IPython uses distutils, so you can install it by simply typing at
39 3. IPython uses distutils, so you can install it by simply typing at
40 the system prompt (don't type the $)::
40 the system prompt (don't type the $)::
41
41
42 $ python setup.py install
42 $ python setup.py install
43
43
44 Note that this assumes you have root access to your machine. If
44 Note that this assumes you have root access to your machine. If
45 you don't have root access or don't want IPython to go in the
45 you don't have root access or don't want IPython to go in the
46 default python directories, you'll need to use the ``--home`` option
46 default python directories, you'll need to use the ``--home`` option
47 (or ``--prefix``). For example::
47 (or ``--prefix``). For example::
48
48
49 $ python setup.py install --home $HOME/local
49 $ python setup.py install --home $HOME/local
50
50
51 will install IPython into $HOME/local and its subdirectories
51 will install IPython into $HOME/local and its subdirectories
52 (creating them if necessary).
52 (creating them if necessary).
53 You can type::
53 You can type::
54
54
55 $ python setup.py --help
55 $ python setup.py --help
56
56
57 for more details.
57 for more details.
58
58
59 Note that if you change the default location for ``--home`` at
59 Note that if you change the default location for ``--home`` at
60 installation, IPython may end up installed at a location which is
60 installation, IPython may end up installed at a location which is
61 not part of your $PYTHONPATH environment variable. In this case,
61 not part of your $PYTHONPATH environment variable. In this case,
62 you'll need to configure this variable to include the actual
62 you'll need to configure this variable to include the actual
63 directory where the IPython/ directory ended (typically the value
63 directory where the IPython/ directory ended (typically the value
64 you give to ``--home`` plus /lib/python).
64 you give to ``--home`` plus /lib/python).
65
65
66
66
67 Mac OSX information
67 Mac OSX information
68 -------------------
68 -------------------
69
69
70 Under OSX, there is a choice you need to make. Apple ships its own build
70 Under OSX, there is a choice you need to make. Apple ships its own build
71 of Python, which lives in the core OSX filesystem hierarchy. You can
71 of Python, which lives in the core OSX filesystem hierarchy (/System/Library/Frameworks/Python.framework). You can
72 also manually install a separate Python, either purely by hand
72 also manually install a separate Python, either purely by hand
73 (typically in /usr/local) or by using Fink, which puts everything under
73 (typically in /usr/local), by using Fink or DarwinPorts, which put everything under /sw or /opt respectively, or using the python.org "Framework" python, which installs a framework similar to the system python in /Library/Frameworks. The Enthought Python Distribution (http://www.enthought.com/products/epd.php), uses the python.org "Framework" python and thus also installs into /Library/Frameworks. Which route to follow is a matter of personal preference, as I've seen users who favor each of the approaches.
74 /sw. Which route to follow is a matter of personal preference, as I've
74
75 seen users who favor each of the approaches. Here I will simply list the
75 For users of OS X 10.5 (Leopard), the system python installation contains support for `DTrace`_, a kernel-level profiling system integrated into OS X 10.5. This facility provides significant advantage to developers and users interested in high-performance computing by using the system python.
76 known installation issues under OSX, along with their solutions.
76
77 .. _DTrace: http://www.apple.com/macosx/technology/unix.html
78
79 IPython is known to work with all the above installation options. As such, we do not endorse one choice over the others. Here we will simply list the known installation issues under OSX, along with their solutions.
77
80
78 This page: http://geosci.uchicago.edu/~tobis/pylab.html contains
81 This page: http://geosci.uchicago.edu/~tobis/pylab.html contains
79 information on this topic, with additional details on how to make
82 information on this topic, with additional details on how to make
80 IPython and matplotlib play nicely under OSX.
83 IPython and matplotlib play nicely under OSX.
81
84
82 To run IPython and readline on OSX "Leopard" system python, see the
83 wiki page at http://ipython.scipy.org/moin/InstallationOSXLeopard
84
85
85
86 GUI problems
86 GUI problems (older versions of OS X)
87 ------------
87 -------------------------------------
88
88
89 The following instructions apply to an install of IPython under OSX from
89 The following instructions apply to an install of IPython under OSX before OS X 10.5 (users of OS X 10.5 see [#]_ ) by unpacking the .tar.gz distribution and installing it for the default Python interpreter shipped by Apple. If you are using a fink or DarwinPorts install, they will take care of these details for you, by installing IPython against their Python.
90 unpacking the .tar.gz distribution and installing it for the default
91 Python interpreter shipped by Apple. If you are using a fink install,
92 fink will take care of these details for you, by installing IPython
93 against fink's Python.
94
90
95 IPython offers various forms of support for interacting with graphical
91 IPython offers various forms of support for interacting with graphical
96 applications from the command line, from simple Tk apps (which are in
92 applications from the command line, from simple Tk apps (which are in
97 principle always supported by Python) to interactive control of WX, Qt
93 principle always supported by Python) to interactive control of WX, Qt
98 and GTK apps. Under OSX, however, this requires that ipython is
94 and GTK apps. Under OSX, however, this requires that ipython is
99 installed by calling the special pythonw script at installation time,
95 installed by calling the special pythonw script at installation time,
100 which takes care of coordinating things with Apple's graphical environment.
96 which takes care of coordinating things with Apple's graphical environment.
101
97
102 So when installing under OSX, it is best to use the following command::
98 So when installing under OSX, it is best to use the following command::
103
99
104 $ sudo pythonw setup.py install --install-scripts=/usr/local/bin
100 $ sudo pythonw setup.py install --install-scripts=/usr/local/bin
105
101
106 or
102 or::
107
103
108 $ sudo pythonw setup.py install --install-scripts=/usr/bin
104 $ sudo pythonw setup.py install --install-scripts=/usr/bin
109
105
110 depending on where you like to keep hand-installed executables.
106 depending on where you like to keep hand-installed executables.
111
107
112 The resulting script will have an appropriate shebang line (the first
108 The resulting script will have an appropriate shebang line (the first
113 line in the script whic begins with #!...) such that the ipython
109 line in the script whic begins with #!...) such that the ipython
114 interpreter can interact with the OS X GUI. If the installed version
110 interpreter can interact with the OS X GUI. If the installed version
115 does not work and has a shebang line that points to, for example, just
111 does not work and has a shebang line that points to, for example, just
116 /usr/bin/python, then you might have a stale, cached version in your
112 /usr/bin/python, then you might have a stale, cached version in your
117 build/scripts-<python-version> directory. Delete that directory and
113 build/scripts-<python-version> directory. Delete that directory and
118 rerun the setup.py.
114 rerun the setup.py.
119
115
120 It is also a good idea to use the special flag ``--install-scripts`` as
116 It is also a good idea to use the special flag ``--install-scripts`` as
121 indicated above, to ensure that the ipython scripts end up in a location
117 indicated above, to ensure that the ipython scripts end up in a location
122 which is part of your $PATH. Otherwise Apple's Python will put the
118 which is part of your $PATH. Otherwise Apple's Python will put the
123 scripts in an internal directory not available by default at the command
119 scripts in an internal directory not available by default at the command
124 line (if you use /usr/local/bin, you need to make sure this is in your
120 line (if you use /usr/local/bin, you need to make sure this is in your
125 $PATH, which may not be true by default).
121 $PATH, which may not be true by default).
126
122
123 .. [#] Users of OS X 10.5 who choose to use the system-installed python should install IPython using ``sudo python setupegg.py install`` from the IPython source directory or from `PyPI`_ using ``sudo easy_install ipython``.
124
125 .. _PyPI: http://pypi.python.org/pypi
127
126
128 Readline problems
127 Readline problems
129 -----------------
128 -----------------
130
129
131 By default, the Python version shipped by Apple does not include the
130 By default, the Python version shipped by Apple before OS X 10.5 does not include the readline library, so central to IPython's behavior. If you install
132 readline library, so central to IPython's behavior. If you install
133 IPython against Apple's Python, you will not have arrow keys, tab
131 IPython against Apple's Python, you will not have arrow keys, tab
134 completion, etc. For Mac OSX 10.3 (Panther), you can find a prebuilt
132 completion, etc. For Mac OSX 10.3 (Panther), you can find a prebuilt
135 readline library here:
133 readline library here:
136 http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip
134 http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip
137
135
138 If you are using OSX 10.4 (Tiger), after installing this package you
136 If you are using OSX 10.4 (Tiger), after installing this package you
139 need to either:
137 need to either:
140
138
141 1. move readline.so from /Library/Python/2.3 to
139 1. move readline.so from /Library/Python/2.3 to
142 /Library/Python/2.3/site-packages, or
140 /Library/Python/2.3/site-packages, or
143 2. install http://pythonmac.org/packages/TigerPython23Compat.pkg.zip
141 2. install http://pythonmac.org/packages/TigerPython23Compat.pkg.zip
144
142
145 Users installing against Fink's Python or a properly hand-built one
146 should not have this problem.
147
143
144 Beginning with OS X 10.5, Apple's python installation uses libedit, a BSD-licensed not-quite-compatible readline replacement. As of IPython 0.9, many of the issues related to the differences between readline and libedit have been resolved. If you find that you are experiencing readline-related issues (e.g. problems with tab-completion, history movement, or line editing), you can install Ludwig Schwartz's readline package which effectively replaces libedit with readline for packages installed via setuptools. If you installed IPython from the source directory using::
145
146 sudo python setupegg.py
147
148 or from PyPI with::
149
150 sudo easy_install ipython
151
152 then you can install the readline egg via [#]_::
153
154 sudo easy_install readline
155
156 If needed, the readline egg can be build and installed from source (see the
157 wiki page at http://ipython.scipy.org/moin/InstallationOSXLeopard).
158
159 Users installing against Fink or DarwinPorts's Python or a properly hand-built python installation should not have this problem.
160
161 .. [#] If you have installed SVN 1.5, you will also to install a patch to setuptools before installing the readline egg. Use ``sudo easy_install http://www.jaraco.com/ASP/eggs/setuptools-0.6c8_svn15fix.egg``.
148
162
149 DarwinPorts
163 DarwinPorts
150 -----------
164 -----------
151
165
152 I report here a message from an OSX user, who suggests an alternative
166 I report here a message from an OSX user, who suggests an alternative
153 means of using IPython under this operating system with good results.
167 means of using IPython under this operating system with good results.
154 Please let me know of any updates that may be useful for this section.
168 Please let me know of any updates that may be useful for this section.
155 His message is reproduced verbatim below:
169 His message is reproduced verbatim below:
156
170
157 From: Markus Banfi <markus.banfi-AT-mospheira.net>
171 From: Markus Banfi <markus.banfi-AT-mospheira.net>
158
172
159 As a MacOS X (10.4.2) user I prefer to install software using
173 As a MacOS X (10.4.2) user I prefer to install software using
160 DawinPorts instead of Fink. I had no problems installing ipython
174 DawinPorts instead of Fink. I had no problems installing ipython
161 with DarwinPorts. It's just:
175 with DarwinPorts. It's just:
162
176
163 sudo port install py-ipython
177 sudo port install py-ipython
164
178
165 It automatically resolved all dependencies (python24, readline,
179 It automatically resolved all dependencies (python24, readline,
166 py-readline). So far I did not encounter any problems with the
180 py-readline). So far I did not encounter any problems with the
167 DarwinPorts port of ipython.
181 DarwinPorts port of ipython.
168
182
169
183
170
184
171 Windows instructions
185 Windows instructions
172 --------------------
186 --------------------
173
187
174 Some of IPython's very useful features are:
188 Some of IPython's very useful features are:
175
189
176 * Integrated readline support (Tab-based file, object and attribute
190 * Integrated readline support (Tab-based file, object and attribute
177 completion, input history across sessions, editable command line,
191 completion, input history across sessions, editable command line,
178 etc.)
192 etc.)
179 * Coloring of prompts, code and tracebacks.
193 * Coloring of prompts, code and tracebacks.
180
194
181 .. _pyreadline:
195 .. _pyreadline:
182
196
183 These, by default, are only available under Unix-like operating systems.
197 These, by default, are only available under Unix-like operating systems.
184 However, thanks to Gary Bishop's work, Windows XP/2k users can also
198 However, thanks to Gary Bishop's work, Windows XP/2k users can also
185 benefit from them. His readline library originally implemented both GNU
199 benefit from them. His readline library originally implemented both GNU
186 readline functionality and color support, so that IPython under Windows
200 readline functionality and color support, so that IPython under Windows
187 XP/2k can be as friendly and powerful as under Unix-like environments.
201 XP/2k can be as friendly and powerful as under Unix-like environments.
188
202
189 This library, now named PyReadline, has been absorbed by the IPython
203 This library, now named PyReadline, has been absorbed by the IPython
190 team (JΓΆrgen Stenarson, in particular), and it continues to be developed
204 team (JΓΆrgen Stenarson, in particular), and it continues to be developed
191 with new features, as well as being distributed directly from the
205 with new features, as well as being distributed directly from the
192 IPython site.
206 IPython site.
193
207
194 The PyReadline extension requires CTypes and the windows IPython
208 The PyReadline extension requires CTypes and the windows IPython
195 installer needs PyWin32, so in all you need:
209 installer needs PyWin32, so in all you need:
196
210
197 1. PyWin32 from http://sourceforge.net/projects/pywin32.
211 1. PyWin32 from http://sourceforge.net/projects/pywin32.
198 2. PyReadline for Windows from
212 2. PyReadline for Windows from
199 http://ipython.scipy.org/moin/PyReadline/Intro. That page contains
213 http://ipython.scipy.org/moin/PyReadline/Intro. That page contains
200 further details on using and configuring the system to your liking.
214 further details on using and configuring the system to your liking.
201 3. Finally, only if you are using Python 2.3 or 2.4, you need CTypes
215 3. Finally, only if you are using Python 2.3 or 2.4, you need CTypes
202 from http://starship.python.net/crew/theller/ctypes(you must use
216 from http://starship.python.net/crew/theller/ctypes(you must use
203 version 0.9.1 or newer). This package is included in Python 2.5,
217 version 0.9.1 or newer). This package is included in Python 2.5,
204 so you don't need to manually get it if your Python version is 2.5
218 so you don't need to manually get it if your Python version is 2.5
205 or newer.
219 or newer.
206
220
207 Warning about a broken readline-like library: several users have
221 Warning about a broken readline-like library: several users have
208 reported problems stemming from using the pseudo-readline library at
222 reported problems stemming from using the pseudo-readline library at
209 http://newcenturycomputers.net/projects/readline.html. This is a broken
223 http://newcenturycomputers.net/projects/readline.html. This is a broken
210 library which, while called readline, only implements an incomplete
224 library which, while called readline, only implements an incomplete
211 subset of the readline API. Since it is still called readline, it fools
225 subset of the readline API. Since it is still called readline, it fools
212 IPython's detection mechanisms and causes unpredictable crashes later.
226 IPython's detection mechanisms and causes unpredictable crashes later.
213 If you wish to use IPython under Windows, you must NOT use this library,
227 If you wish to use IPython under Windows, you must NOT use this library,
214 which for all purposes is (at least as of version 1.6) terminally broken.
228 which for all purposes is (at least as of version 1.6) terminally broken.
215
229
216
230
217 Installation procedure
231 Installation procedure
218 ----------------------
232 ----------------------
219
233
220 Once you have the above installed, from the IPython download directory
234 Once you have the above installed, from the IPython download directory
221 grab the ipython-XXX.win32.exe file, where XXX represents the version
235 grab the ipython-XXX.win32.exe file, where XXX represents the version
222 number. This is a regular windows executable installer, which you can
236 number. This is a regular windows executable installer, which you can
223 simply double-click to install. It will add an entry for IPython to your
237 simply double-click to install. It will add an entry for IPython to your
224 Start Menu, as well as registering IPython in the Windows list of
238 Start Menu, as well as registering IPython in the Windows list of
225 applications, so you can later uninstall it from the Control Panel.
239 applications, so you can later uninstall it from the Control Panel.
226
240
227 IPython tries to install the configuration information in a directory
241 IPython tries to install the configuration information in a directory
228 named .ipython (_ipython under Windows) located in your 'home'
242 named .ipython (_ipython under Windows) located in your 'home'
229 directory. IPython sets this directory by looking for a HOME environment
243 directory. IPython sets this directory by looking for a HOME environment
230 variable; if such a variable does not exist, it uses HOMEDRIVE\HOMEPATH
244 variable; if such a variable does not exist, it uses HOMEDRIVE\HOMEPATH
231 (these are always defined by Windows). This typically gives something
245 (these are always defined by Windows). This typically gives something
232 like C:\Documents and Settings\YourUserName, but your local details may
246 like C:\Documents and Settings\YourUserName, but your local details may
233 vary. In this directory you will find all the files that configure
247 vary. In this directory you will find all the files that configure
234 IPython's defaults, and you can put there your profiles and extensions.
248 IPython's defaults, and you can put there your profiles and extensions.
235 This directory is automatically added by IPython to sys.path, so
249 This directory is automatically added by IPython to sys.path, so
236 anything you place there can be found by import statements.
250 anything you place there can be found by import statements.
237
251
238
252
239 Upgrading
253 Upgrading
240 ---------
254 ---------
241
255
242 For an IPython upgrade, you should first uninstall the previous version.
256 For an IPython upgrade, you should first uninstall the previous version.
243 This will ensure that all files and directories (such as the
257 This will ensure that all files and directories (such as the
244 documentation) which carry embedded version strings in their names are
258 documentation) which carry embedded version strings in their names are
245 properly removed.
259 properly removed.
246
260
247
261
248 Manual installation under Win32
262 Manual installation under Win32
249 -------------------------------
263 -------------------------------
250
264
251 In case the automatic installer does not work for some reason, you can
265 In case the automatic installer does not work for some reason, you can
252 download the ipython-XXX.tar.gz file, which contains the full IPython
266 download the ipython-XXX.tar.gz file, which contains the full IPython
253 source distribution (the popular WinZip can read .tar.gz files). After
267 source distribution (the popular WinZip can read .tar.gz files). After
254 uncompressing the archive, you can install it at a command terminal just
268 uncompressing the archive, you can install it at a command terminal just
255 like any other Python module, by using 'python setup.py install'.
269 like any other Python module, by using 'python setup.py install'.
256
270
257 After the installation, run the supplied win32_manual_post_install.py
271 After the installation, run the supplied win32_manual_post_install.py
258 script, which creates the necessary Start Menu shortcuts for you.
272 script, which creates the necessary Start Menu shortcuts for you.
259
273
260
274
261 .. upgrading:
275 .. upgrading:
262
276
263 Upgrading from a previous version
277 Upgrading from a previous version
264 ---------------------------------
278 ---------------------------------
265
279
266 If you are upgrading from a previous version of IPython, you may want
280 If you are upgrading from a previous version of IPython, you may want
267 to upgrade the contents of your ~/.ipython directory. Just run
281 to upgrade the contents of your ~/.ipython directory. Just run
268 %upgrade, look at the diffs and delete the suggested files manually,
282 %upgrade, look at the diffs and delete the suggested files manually,
269 if you think you can lose the old versions. %upgrade will never
283 if you think you can lose the old versions. %upgrade will never
270 overwrite or delete anything.
284 overwrite or delete anything.
271
285
272
286
General Comments 0
You need to be logged in to leave comments. Login now