LoginSignup
2
0

More than 5 years have passed since last update.

リモートで使用している jupyter notebook が作動しない

Last updated at Posted at 2017-10-11

考えられる原因

1.リモートで使うための設定ができていない
2.初回ログインでトークンのパスが通っていない
3.(複数の人間で同じサーバにアクセスする場合)ポート番号がコンフリクトしている
4.その他

1.リモートで使うための設定

ここが大元。
https://jupyter-notebook.readthedocs.io/en/stable/public_server.html

要点をまとめると、
1.jupyter notebook --generate-config をターミナルに打ち込んでconfigを生成。
2.pip install ipython でipythonのインストール。
3.以下のコードをターミナルで実行し、sha鍵の生成。
ipython
In [1]: from IPython.lib import passwd
In [2]: passwd()

4.その鍵を使用し、必要部分を編集
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.password = u'sha1:XXXXXXXXX' #先に生成したsha鍵を記述
c.NotebookApp.extra_template_paths = [os.path.join(jupyter_data_dir(), 'templates') ]
c.NotebookApp.server_extensions = ['nbextensions']

2.初回ログインでトークンのパスが通っていない

jupyter notebook
とターミナルに打ち込み、起動した際に表示される、
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:

以下に書かれているトークンを
スクリーンショット 2017-10-11 15.12.29.png
の窓枠の中に打ち込めばOKです。

3.ポート番号がコンフリクトしている

これは、jupyter notebookの設定以前の問題なのですが、複数人で同時に作業する場合、ポートの番号がコンフリクトを起こすと作業できません。各自、別々のポート番号でログインしていることも念のため確認しましょう。(基本的には、ポート番号がかぶることはないはずですが。。。)

4.その他

ちなみに、参照先を貼るにとどめますが、jupyter labのインストールによって動作しなくなる場合もあるようです。
https://github.com/jupyterlab/jupyterlab/issues/312

参照

qiita Jupyterを導入しよう -リモート編- https://qiita.com/Miggy/items/5466a2c1e968602f3ebe
jupyter notebookドキュメント https://jupyter-notebook.readthedocs.io/en/stable/public_server.html
github Once jupyterlab is installed in one conda environment, it can prevent notebooks from opening in clean env #312 https://github.com/jupyterlab/jupyterlab/issues/312

2
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
2
0