The recommended way to install Jupyter (new name for IPython Notebook) is now using Anaconda.
IPython Notebook is a great tool for prototyping algorithms and analysing data interactively, in particular in combination with powerful numerical libraries such as NumPy, SciPy, matplotlib and OpenCV. But one step after the other.
The IPython install page mentions Python distributions such as Anaconda or Enthought Canopy that come with many packages pre-installed, but I prefer to install all bits from scratch, so I know what’s installed.
So let’s get started on how to install IPython Notebook on Windows 7. Obviously we need admin rights for all of this.
- Install Python
A late 2-series Python, such as 2.7.5, provides the best compatibility with most packages, although support for Python 3 is continuously improving. I also stick to the Win32 (x86) version of Python as a few packages are not available in x64 versions, although the major packages do support this. My favourite Python distribution for Windows is ActivePython. Note that its default install path is
C:\Python27\, which should be changed, e.g. to
C:\Program Files (x86)\ActivePython 2.7.5\.
- Install IPython
The easiest way is to run
easy_install ipython[all]as an administrator (start button, type
cmd, shift+right click on “cmd.exe” and select “Run as administrator”). This installs the latest stable version of IPython including the main required and optional dependencies.
- Install libraries
Download and run the official installers for the latest stable versions of NumPy (numerical routines), SciPy (scientific computing) and matplotlib (graphing library). Make sure you pick the version that fits your Python distribution (e.g. win32 python2.7). Note that matplotlib requires additional dependencies that can be installed using
easy_install python-dateutil pyparsing.
- Install OpenCV bindings (optional)
If one works with image processing or computer vision, the Python bindings of OpenCV can be really useful. The python bindings are included in the main OpenCV installer under the path
./build/python/, but as of OpenCV 2.4.8 only Python 2.7 is included as precompiled Python binary (but for both 32 and 64-bit versions). The file “cv2.pyd” needs to be manually copied to the “site-packages” folder of the Python distribution, e.g. at
C:\Program Files (x86)\ActivePython 2.7.5\Lib\site-packages\.
- Start IPython Notebook
ipython notebookin a command line. If you’re new to IPython Notebook, get started by looking at the example collection and reading the documentation.
- Install MathJax locally (optional)
Typesetting LaTeX within a notebook uses MathJax, which can be installed locally by running the following in Python:
from IPython.external.mathjax import install_mathjax install_mathjax()
As of March 2014, the latest versions of libraries were: IPython 1.2.1, NumPy 1.8.0, SciPy 0.13.3, matplotlib 1.3.1, OpenCV 2.4.8.