Setting up IPython Notebook on Windows

Setting up IPython Notebook on Windows

Posted on 13 March 2014 at 19:27.

Written byChristian Richardt

IPython Notebookis a great tool for prototyping algorithms and analysing data interactively, in particular in combination with powerful numerical libraries such asNumPy,SciPy,matplotlibandOpenCV. But one step after the other.

TheIPython install pagementions Python distributions such asAnacondaorEnthought Canopythat 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 isActivePython. Note that its default install path isC:\Python27\, which should be changed, e.g. toC:\Program Files (x86)\ActivePython 2.7.5\.

Install IPython

Theeasiest wayis to runeasy_install ipython[all]as an administrator (start button, typecmd, 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 ofNumPy(numerical routines),SciPy(scientific computing) andmatplotlib(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 usingeasy_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 themain OpenCV installerunder 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. atC:\Program Files (x86)\ActivePython 2.7.5\Lib\site-packages\.

Start IPython Notebook

Runipython notebookin a command line. If you’re new to IPython Notebook, get started by looking at theexample collectionand reading thedocumentation.

Install MathJax locally(optional)

Typesetting LaTeX within a notebook usesMathJax, which can beinstalled locallyby running the following in Python:

fromIPython.external.mathjaximportinstall_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.

你可能感兴趣的:(Setting up IPython Notebook on Windows)