LoginSignup
3
8

More than 3 years have passed since last update.

JupyterLab3.0の起動ブラウザを指定する方法

Last updated at Posted at 2021-01-04

はじめに

JupyterLabのバージョンを2.2.0から3.0.0にアップグレードすると、起動ブラウザ指定がうまくいかなかったので、解決方法をメモします。

環境

  • Python(3.7.6)
  • JupyterLab(3.0.0)

うまくいかない状態

 まず、うまくいかない状態を説明します。ウェブでJupyterLab ブラウザ指定と調べると、次の方法が載っています。コマンドラインで、

command
jupyter notebook --generate-config

を打ち込み、~/.jupyter/jupyter/jupyter_notebook_config.pyを作り、jupyter_notebook_config.py内で

jupyter_notebook_config.py
c.NotebookApp.browser='"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe\" %s'

を指定する方法です。JupyterLab 2.x.xまでは、起動の際、jupyter_notebook_config.pyも参照しているようです。

 しかし、JuypterLab 3.0.0になると、上記の設定をしても起動ブラウザを指定できません1。指定方法が変更になっています。

解決方法

 単純ですが、jupyter labでconfigファイルを作成します。コマンドラインで、

command
jupyter lab --generate-config

を実行すると、~/.jupyter/jupyter_lab_config.pyが作成されます。~/.jupyter/jupyter_lab_config.py内の

jupyter_lab_config.py
c.ServerApp.browser = '"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe\" %s'

のコメントアウトを外し、ブラウザexeのパスを記入して、保存します。そうすると、jupyter labでの起動ブラウザを指定することができます。"jupyter_lab_config.py"のファイル名は、"jupyter_server_config.py"であってもよいようです1

参考

3
8
2

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
3
8