LoginSignup
2
4

More than 3 years have passed since last update.

vps 上の Arch Linux に Jupyter notebook をインストール

Last updated at Posted at 2018-07-06

次のページを参考にしました。
Jupyterを導入しよう -リモート編-
リモートサーバでjupyter notebookを起動させローカル環境で使う

1) Jupyter のインストール
次のページにあります。
Jupyter Installation

sudo pacman -S jupyter-notebook
sudo jupyter nbextension enable --py --sys-prefix widgetsnbextension
sudo pacman -S ipython

2) sha鍵 の生成

$ ipython
Python 3.6.6 (default, Jun 27 2018, 13:11:40) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.3.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from IPython.lib import passwd

In [2]: passwd()
Enter password: 
Verify password: 
Out[2]: 'sha1:5ade54f818*************************'

3) 環境設定

jupyter notebook --generate-config

.jupyter/jupyter_notebook_config.py
というファイルが出来ます。

4) .jupyter/jupyter_notebook_config.py の編集

.jupyter/jupyter_notebook_config.py
# Configuration file for jupyter-notebook.
from jupyter_core.paths import jupyter_config_dir, jupyter_data_dir
import os.path
import sys
sys.path.append(os.path.join(jupyter_data_dir(), 'extensions'))

c = get_config()
# 略
#
# 該当する箇所のコメントアウトを外して編集

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']
#

5) Jupyter Notebook の起動

jupyter notebook

6) クライアントでアクセス

jupyter_jul06.png

$ jupyter --version
jupyter core     : 4.6.3
jupyter-notebook : 6.0.3
qtconsole        : not installed
ipython          : 7.13.0
ipykernel        : 5.1.4
jupyter client   : 6.0.0
jupyter lab      : not installed
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 4.4.0
traitlets        : 4.3.3
2
4
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
4