LoginSignup
56

More than 5 years have passed since last update.

ipython notebook(jupyter)をリモートから使う

Last updated at Posted at 2016-01-19

環境

Ubuntu 14.04 LTS
anaconda 3.19.0
python 2.7.X

ipython notebookとjupyterとの関係

http://blog.jupyter.org/2015/08/12/first-release-of-jupyter/
今後、ipython notebookはjupyterになるということですかね。
今まで出ていたコマンドも置き換えるように推奨されてます。

実行手順

1.profileの生成
profileは不要になったようです
2. notebook_config.pyファイルの生成
jupyter notebook --generate-config
でconfigファイル(~/.jupyter/jupyter_notebook_config.py)を作成。
3. ipythonを実行、下記のコマンドでパスワードのハッシュ値を生成
In [1]: from IPython.lib import passwd
In [2]: passwd()
ここでパスワードを打ち込むとハッシュ値が生成(sha1:XXXXXXX)されるので、
そちらをコピーして、テキストファイルなどに保存。
4. ~/.jupyter/jupyter_notebook_config.pyの末尾に下記を記載

c.IPKernelApp.pylab = 'inline'
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 9999
c.NotebookApp.password = u'sha1:XXXXXXX(#先ほど保存したハッシュ値を記載)'

5. 実行
jupyter notebook &

これで、リモートクライアントのブラウザから
http://<jupyter実行ホストのIP Address>:9999
と打ち込むとipythonにアクセスできるようになります。
アクセス元を絞りたい時には,c.NotebookApp.ip = ''の部分を修正してください

追記

Jupyter>5.7から

c.NotebookApp.ip = '*'
ではなく
c.NotebookApp.ip = '0.0.0.0'
にする必要があるそうです。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
56