1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jupyter notebookのconfigの設定

Last updated at Posted at 2018-03-20

機械学習の実装で、tensorflow/tensorflowなどのDocker Imageを使って、コンテナを立てまくっているのですが、
jupyter notebookのポートの設定などよく忘れるので備忘ログ

・足りていないモジュールを入れる and vimを入れる

apt-get update
apt-get install vim

・configファイルを開く

vim ~/.jupyter//jupyter_notebook_config.py

・configファイルの中身

import os
from IPython.lib import passwd

c.NotebookApp.ip = '*'
# PORTの設定。dockerコンテナのポートと合わせる
c.NotebookApp.port = int(os.getenv('PORT', 8888))
c.NotebookApp.open_browser = False
# c.MultiKernelManager.default_kernel_name = 'python2' # 起動するpythonのバージョンを切り替えたいとき。
# --allow-rootの設定
c.NotebookApp.allow_root = True

# sets a password if PASSWORD is set in the environment
if 'PASSWORD' in os.environ:
  c.NotebookApp.password = passwd(os.environ['PASSWORD'])
  del os.environ['PASSWORD']

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?