ipython notebook

env

set PYTHONHOME=c:\Python27
set PYTHONPATH=c:\Python27\Lib
set PATH=%PYTHONHOME%;%PYTHONHOME%\Scripts;%PATH%

install ipython notebook

python ez_setup.py

rem ### wget https://bootstrap.pypa.io/get-pip.py —no-check-certificate
python get-pip.py
pip install “ipython[notebook]”
pip install ipython[all]

rem ### @see https://gist.github.com/fyears/7601881
pip install -U setuptools
pip install -U pip

pip install numpy
pip install scipy
pip install matplotlib
pip install pandas
pip install ipython[all]

rem ### you may lack of visual c compiler for python
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27
just download and install it.

rem ### get pydata-book
git clone http://github.com/pydata/pydata-book

windows下安裝Anaconda比較省事

wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.4.1-Windows-x86_64.exe —no-check-certificate

安裝完Anaconda後就可以執行 ipython noteook ,開啟 http://localhost:8888/ 就可看到 jupyter 的 web 介面
接下來可以按靠近右上的”new”按鈕;選擇python2建立新的notebook
建立了新的notebook,可以在running tab裡看到目前正在運作的所有notebook。(每個notebook會對映到各自的.ipynb檔案)

ubuntu下直接sudo apt-get install ipython-book

keyboard shortcuts ctrl-m h

enter    enter edit mode

shift- enter run cell, select below
ctrl- enter run cell
alt- enter run cell, insert below

建立可以遠端操作的ipython notebook

create profile

ipython profile create nbserver

setup password

python -c “import IPython;print IPython.lib.passwd()”
or
IN [1]: from IPython.lib import passwd
IN [2]: passwd()
Enter password:
Verify password:
Out[2]: ‘sha1:xxxxxxxxxxxxxxxxxxxxxxxxx’

create certificate

openssl req -x509 -nodes -days 10000 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem

edit ~/.ipython/profile_nbserver/ipython_notebook_config.py

c = get_config()
c.IPKernerlApp.pylab = ‘inline’
c.NotebookApp.ip = ‘*’
c.NotebookApp.open_browser = False
c.NotebookApp.password = u’sha1:xxxx your hashed password’
c.Notebook.App.port = 9999 #可設為其他端口

if necessary edit firewall /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -m state —state NEW -m tcp -p tcp —dport 9999 -j ACCEPT
-A OUTPUT -m state —state NEW -m tcp -p tcp —dport 9999 -j ACCEPT

start server

ipython notebook —profile=nbserver —certfile=/path/to/your/mycert.pem

open client

https://yourserver:9999