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.

最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容