« matplotlibをつかってxkcd風のプロット | トップページ | IPython Notebook使ってみた。 »

2013年1月29日 (火)

How to use IPython notebook on Portable Python (Windows XP/7/8)

Have you tried IPython Notebook yet? There are lots of buzz around.. Those of you who do not know or need some update should check the talk by Brian Granger from 14:35.

Also, here is the official documentation: An HTML Notebook IPython 

Testing

It looks really cool! Ok, let’s start installing.

Usually the best way to install python scientific packages in Windows is to use Python(x,y) but IPython Notebook requires newer IPython than what Python(x,y) currently packages (IPython 0.10.2.5). They are working on it to update. Meanwhile, we can test IPython Notebook using Portable Python.

Why Portable Python? A nice thing about Portable Python is that it will be completely separated from the system python or even older versions of Portable Python, because it will just create a new folder for it and its designed to be portable! IMO, in Windows, Portable Python is much better than virtualenv.

So, first of all, we need the Portable Python 2.7.3.2 or higher which installs PyQt4 along with other libraries (QtConsole and Notebook need PyQt4).

Installing new packages in Portable Python is easy: just use easy_install provided in Portable Python. 

  1. go to app/scripts folder and locate “easy_install.exe” there. 
  2. now open a command prompt (cmd) and cd to this folder.
  3. then, easy_install [package_name]

So, let’s install the latest release version of ipython by:

easy_install ipython

This grabbed ipython-0.13.1-py2.7 for me.

Now still from app/scripts, let's test ipython.exe

ipython.exe

This should work, but will complain about pyreadline and ctypes (this can be ignored, because we are using Python 2.7). So, let’s get pyreadline:

easy_install pyreadline

After you made sure that ipython is working, type in:

easy_install ipython[zmq,qtconsole,notebook,test]

This should grab all the dependencies for IPython Notebook.

Then still from app/scripts folder, run ipython with notebook option.

ipython notebook

Done!

Ipythonnotebook_server

In my environment, IE9 is launched. I thought IE9 does not support web-socket. 

Reading this pointed me to use "--no-browser" option. Now, I can use my favorite browser Firefox (any modern browsers that support web-socket, like latest chrome and Firefox, will do) and go to the server address (e.g. http://127.0.0.1:8892/).  Your port number will be found on the console output after lunching the server. 
ipython.exe notebook --no-browser
When you are done, [Ctrl+C] on the command Prompt will shutdown the server.

« matplotlibをつかってxkcd風のプロット | トップページ | IPython Notebook使ってみた。 »

学問・資格」カテゴリの記事

Python」カテゴリの記事

見栄」カテゴリの記事

英語」カテゴリの記事

コメント

コメントを書く

(ウェブ上には掲載しません)

トラックバック


この記事へのトラックバック一覧です: How to use IPython notebook on Portable Python (Windows XP/7/8):

« matplotlibをつかってxkcd風のプロット | トップページ | IPython Notebook使ってみた。 »

しろののツイッタータイムライン

  • ツイッターは5つ目も凍結されました。6つ目での復活も不可能。なのでnoteに注力しています。

    と思ったら、イーロン・マスクの買収が公になってアカウントが復活できました。ありがとうマスク。

    トランプ関連記事の一覧リスト

オススメたち

2024年12月
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

はてブ

無料ブログはココログ