IT管理のマメ知識

ITについて個人の感想をアウトプットしているブログ

別コンピュータのJupitorNoteBookに接続したい

Windows環境にインストールされたAnnacondaのJupitorNoteBookを、別コンピュータから利用するために必要な手順です。

Annacondaホスト側

Anaconda Promptからjupyter notebookのコンフィグファイルを作成します。

[Anaconda Prompt]
(test1) C:\Users\user01>jupyter notebook --generate-config
 [jupyter_notebook_config.py]

## The IP address the notebook server will listen on.
#c.NotebookApp.ip = 'localhost' --> 以下のように書き換えてください。
c.NotebookApp.ip = '0.0.0.0'

  • Anaconda Promptから、[jupyter notebook]を再起動します。
    アクセスに必要なtokenを含んだjupitornotebookへのURLが表示されます。このURLにリモートPCのブラウザからアクセスすることができます。
[Anaconda Prompt]

(test1) C:\Users\user01>jupyter notebook
[I 10:06:26.772 NotebookApp] Serving notebooks from local directory: C:\Users\user01
[I 10:06:26.772 NotebookApp] The Jupyter Notebook is running at:
[I 10:06:26.774 NotebookApp] http://[Host名]:8888/?token=c7bf022cfb45012eNo368b5d87b5366f57f01lq5a95f27b6
[I 10:06:26.774 NotebookApp]  or http://127.0.0.1:8888/?token=c7bf022cfb45012eNo368b5d87b5366f57f01lq5a95f27b6
[I 10:06:26.775 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:06:26.842 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///C:/Users/user01/AppData/Roaming/jupyter/runtime/nbserver-5564-open.html
    Or copy and paste one of these URLs:
        http://[Host名]:8888/?token=c7bf022cfb45012eNo368b5d87b5366f57f01lq5a95f27b6
     or http://127.0.0.1:8888/?token=c7bf022cfb45012eNo368b5d87b5366f57f01lq5a95f27b6

302 GET /?token=c7bf022cfb45012eNo368b5d87b5366f57f01lq5a95f27b6 (192.168.xx.xx) 0.00ms

リモートPC側

  • リモートPCのブラウザから[http://[Host名]:8888]にアクセスし、tokenを入力します。

f:id:persimoon:20201226124407j:plain

  • ログイン成功

f:id:persimoon:20201226124418j:plain