Jupyter Notebook の `Cannot configure while the Jupyter notebook server is running` エラー対策
Jupyter Notebook の Cannot configure while the Jupyter notebook server is running エラー対策
Jupyter Notebook で Cannot configure while the Jupyter notebook server is running エラーが出たときの対処メモ.
今のところ,一時的な対策しかない?
症状
Jupyter関係のモジュールの更新などをしようとするときに,
Cannot configure while the Jupyter notebook server is running エラーが発生する場合がある.
Jupyter Notebookをシャットダウン,PCを再起動(restart, reboot)したとしても,改善されない問題である.
自環境での発生確認
自分の場合,jupyter notebookの拡張機能をアップデートする際に確認.
conda updateしたときに内部で呼ばれるjupyter-contrib-nbextension installコマンドで発生した.
> conda update -c conda-forge jupyter_contrib_nbextensions ... jupyter-contrib-nbextension install --sys-prefix Cannot configure while the Jupyter notebook server is running.
原因
Jupyter notebook serverが動作しているかどうかは,PIDを監視してチェックしているようだが,その処理がうまくいってないぽい.
そのため,常に,Jupyter Notebookが起動していなくても,Jupyter notebook server is runningと認識されている.
対策
一時的な対策として,
‘jupyter-contrib-nbextension‘コマンドでは,このjupyter notebook serverの動作チェックを回避するフラグ--skip-running-checkを使用できる.
jupyter-contrib-nbextension install --skip-running-check
--skip-running-checkフラグがない場合
--help-allオプションですべてのオプションとフラグが確認できる.
次のように表示されない場合,jupyter-contrib-nbextensionのバージョンが古い,またはインストールに失敗している場合がある.
> jupyter-contrib-nbextension install --help-all
Install jupyter_contrib_nbextensions.
Options
-------
Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.
--user
Perform the operation for the current user
--only-config
Edit config files, but do not install/remove nbextensions files
--symlink
Create symlinks for nbextensions instead of copying files
--overwrite
Force overwrite of existing nbextension files, regardless of modification time
--debug
set log level to logging.DEBUG (maximize logging output)
--only-files
Install/remove nbextensions files, but do not edit config files
--skip-running-check
Perform actions even if notebook server(s) are already running
--sys-prefix
Use sys.prefix as the prefix for installing
-s
Create symlinks for nbextensions instead of copying files
--system
Perform the operation system-wide
--prefix=<Unicode> (BaseContribNbextensionsInstallApp.prefix)
Default: ''
Installation prefix, currently only used for nbextensions
--nbextensions=<Unicode> (BaseContribNbextensionsInstallApp.nbextensions_dir)
Default: ''
Full path to nbextensions dir (consider instead using system, sys_prefix,
prefix or user option)
対策
もし,condaでjupyter-contrib-nbextensionをインストールしてうまくいってない場合は,もう1つのパッケージ管理であるpipから最新版をインストールすることで,
--skip-running-checkフラグがあるものをインストールできる.
pip install jupyter_contrib_nbextensions jupyter contrib nbextensions install --sys-prefix --skip-running-check