LoginSignup
0
0

More than 3 years have passed since last update.

ローカル環境のJupitorNoteBookに別ホストからアクセスできるようにする設定

Last updated at Posted at 2020-12-26

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

Annacondaホスト側

  • 以下の2点
    • jupyter notebookの設定
    • Windowsファイアウォールの設定

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


[Anaconda Prompt]
(test1) C:\Users\user01>jupyter notebook
  • Windowsユーザフォルダに[.jupyter\jupyter_notebook_config.py]が作成されます。VSCode等のテキストエディタから、以下を編集します。

 [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を入力します。

Jupitor_remotepc.jpg

  • ログイン成功

Jupitor_remotepc_loggedin.jpg

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