Home | Python | IPython |     Share This Page
IPython: Math Processor
A tool that manipulates mathematics as a word processor manipulates words

Copyright © 2014, Paul LutusMessage Page

Installation | Starting: Command-line | Starting: Notebook | Resources

(double-click any word to see its definition)

Installation

IPython is available for most popular platforms. Here's a concise installation summary distilled from the official IPython installation page (which has more detail):

  • Windows, Macintosh:

    • Install Anaconda.
    • Open a shell session (Windows: command window).
    • Type:
      conda update conda
      conda update ipython
                        
  • Linux:

    1. Install IPython and dependencies:

      • Ubuntu/Debian distributions:

        $ sudo apt-get install ipython-notebook
                            
      • Fedora/related distributions:

        $ sudo yum install python-ipython-notebook
                            
    2. Install math and science libraries:

      • Ubuntu/Debian distributions:

        $ sudo apt-get install python-matplotlib python-scipy \
          python-pandas python-sympy python-nose
                            
      • Fedora/related distributions:

        $ sudo yum install python-matplotlib scipy python-pandas sympy python-nose
                            

Installed Version

The above installation procedures should install IPython version 2.0.0 or newer. Make sure this is so, otherwise some of the examples in these articles won't work. In a shell session, to get the installed IPython version, type:

$ ipython -V
            

The response should be "2.0.0" or higher.

Starting: Command-line

To run IPyton from the command line, open a shell session and type:

$ ipython
            

The response should be something like this (with minor variations):

Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
Type "copyright", "credits" or "license" for more information.

IPython 2.0.0 — An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: 
            
Starting: Notebook

To start the IPython notebook interface, open a shell session and type:

$ ipython notebook
            

A typical IPython response would be:

2014-04-15 13:17:54.003 [NotebookApp] Using existing profile dir: u'/home/username/.ipython/profile_default'
2014-04-15 13:17:54.028 [NotebookApp] Using MathJax from CDN: http://cdn.mathjax.org/mathjax/latest.js
2014-04-15 13:17:54.076 [NotebookApp] Serving notebooks from local directory: /home/username
2014-04-15 13:17:54.076 [NotebookApp] 0 active kernels 
2014-04-15 13:17:54.076 [NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888/
2014-04-15 13:17:54.077 [NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
            

The above shows that IPython has started a local Web server hosting the notebook interface. Make note of the Web server's address and port (often it's 127.0.0.1:8888), and enter it into your favorite browser to begin your notebook session:

Automation

There's no need to type the above commands more than once — starting IPython can be as simple as clicking a desktop icon, a scheme whose details differ depending on the platform.

Resources

Here's a list of IPython-related resources, worth exploring, especially for detailed user documentation and examples:

In the following pages, we apply IPython to the solution of practical problems.

To navigate this article set, use the arrows and drop-down lists at the top and bottom of each page.

Home | Python | IPython |     Share This Page