LoginSignup
7
6

More than 1 year has passed since last update.

Jetson NanoでJupyter labを外部からアクセスできるようにインストールする

Last updated at Posted at 2020-07-25

まず、はじめに更新が必要な場合は、

$sudo apt-get update
$sudo apt-get upgrade

JetsonNanoのSDKをインストールしたら、ターミナルを立ち上げ

$sudo apt install nodejs npm
$sudo apt install python3-pip
$sudo pip3 install jupyter jupyterlab

参考リンク Jupter lab拡張機能
https://jupyterlab.readthedocs.io/en/stable/user/extensions.html

jupyter labのインストールでエラーが出た場合は、次を実行

$sudo apt-get install build-essential libssl-dev libffi-dev python-dev

python setup.py.egg_info failed with error code 1のエラーが出た場合は、Pipのバージョンを確認します。

$pip3 list

pipのバージョンが古い場合は、最新のpipにアップデートします。

$pip3 install --upgrade pip

JupyterNotebookの設定ファイルを生成する

$jupyter notebook --generate-config

設定ファイルの編集をする

$sudo vi /home/takeo/.jupyter/jupyter_notebook_config.py

Writing default config to: /home/takeo/.jupyter/jupyter_notebook_config.py

/を押して

/c.NotebookApp.allow_origin

として検索します。

自己サーバーにアクセス許可設定します。

######c.NotebookApp.allow_origin = ''

コメントアウト(#)は削除し

c.NotebookApp.allow_origin = '*'

に変更し、同じ様にc.NotebookApp.ipを検索します。

#####c.NotebookApp.ip = 'localhost'

コメントアウト#をはずしすべてのIPをリッスン

c.NotebookApp.ip = '0.0.0.0'

に変更します。

ローカルでブラウザを立ち上げないようにします。TrueからFalseに変更。

c.NotebookApp.open_browser = False

:xを実行しviを終了します。

jupyterのパスワードを設定いたします。設定ファイルにハッシュが入ります。

$ jupyter notebook password

[NotebookPasswordApp] Wrote hashed password to /home/takeo/.jupyter/jupyter_notebook_config.json

jupyterを起動します。

$jupyter lab

外部デバイスからブラウザの検索バーにipアドレス:8888でアクセス可能に

#jupyterのバージョン(raspberrypi)
$jupyter --version
jupyter core     : 4.6.3
jupyter-notebook : 6.0.3
qtconsole        : 4.3.1
ipython          : not installed
ipykernel        : 4.9.0
jupyter client   : 6.1.6
jupyter lab      : 2.2.0
nbconvert        : 5.6.1
ipywidgets       : not installed
nbformat         : 5.0.7
traitlets        : 4.3.2

ipythonがインストールされていない場合は、
ipythonをインストールする。

sudo pip3 install ipython==7.9.0

※インストールするときは権限に注意しよう。

$chromium-browser --no-sandbox

jupyter labのバージョンによっては、パスワードトークンを設定してください。

参考

https://jupyter-notebook.readthedocs.io/en/latest/config.html
https://jupyter-server.readthedocs.io/en/latest/operators/public-server.html
7
6
1

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