JupyterLabが動かなくなった¶
訳あってhomebrewで一括アップデートをしたらjupyterlabが動かなくなったからその復活記録を残す
原因はおそらくver2.Xから 3.Xに変わったことによって起きた
official documentation にいろいろ情報があるから参考にする
強制再インストール¶
以下のコマンドで全部消して全部入れ直す
jupyter lab clean --all
pip3 install jupyterlab --force-reinstall
root のカーネルを追加する¶
brewで入れたrootの場所を確認する
前回はwhich root
とかで探していたけど,迷子になることがわかった.
root
を入れた場所を確認する
brew info root
==> Caveats As of ROOT 6.22, you should not need the thisroot scripts; but if you depend on the custom variables set by them, you can still run them: For bash users: . /usr/local/bin/thisroot.sh For zsh users: pushd /usr/local >/dev/null; . bin/thisroot.sh; popd >/dev/null For csh/tcsh users: source /usr/local/bin/thisroot.csh For fish users: . /usr/local/bin/thisroot.fish Emacs Lisp files have been installed to: /usr/local/share/emacs/site-lisp/root
返ってくる文字の一部にpathを通せと言われる.
2. **上記設定を行っていない場合,ちゃんと設定する.**
自分の場合,zshだから
`scho pushd /usr/local >/dev/null; . bin/thisroot.sh; popd >/dev/null >> ~/.zprofile`
とでもしてあげて,pathを通す
3. **rootがいるpathを一応確認**
`echo $ROOTSYS`
4. **rootのkernelを探す**
`ls $ROOTSYS/etc/root/notebook/kernels/root`
があるか確認
5. **rootのkernelをjupyterに食わせる**
`cp -r /usr/local/etc/root/notebook/kernels/root /usr/local/share/jupyter/kernels`
上記設定で終わり.
`jupyter kernelspec list`
でkernels一覧にrootがあるかどうか確認する
以下はメモ¶
エラーコードは
% jupyter lab
/usr/local/lib/python3.9/site-packages/jupyter_server/transutils.py:13: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
warnings.warn(warn_msg, FutureWarning)
[I 2021-05-17 14:59:47.090 ServerApp] jupyterlab | extension was successfully linked.
[W 2021-05-17 14:59:47.291 ServerApp] 'ExtensionManager' object has no attribute '_extensions'
Traceback (most recent call last):
File "/usr/local/bin/jupyter-lab", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/jupyter_server/extension/application.py", line 518, in launch_instance
serverapp = cls.initialize_server(argv=args)
File "/usr/local/lib/python3.9/site-packages/jupyter_server/extension/application.py", line 488, in initialize_server
serverapp.initialize(
File "/usr/local/lib/python3.9/site-packages/traitlets/config/application.py", line 87, in inner
return method(app, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/jupyter_server/serverapp.py", line 1855, in initialize
point = self.extension_manager.extension_points[starter_extension]
File "/usr/local/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 290, in extension_points
extensions = self.extensions
File "/usr/local/lib/python3.9/site-packages/nbclassic/nbserver.py", line 80, in extensions
nb = self._extensions.get("nbclassic")
AttributeError: 'ExtensionManager' object has no attribute '_extensions'
といった感じで,どうやら起動時の初期化?とExtentionが悪さしてるっぽい
Ver2.Xから3.Xへの移植¶
ここには
To migrate from notebook server to plain jupyter server, follow these steps:
・Rename your jupyter_notebook_config.py file to jupyter_server_config.py.
・Rename all c.NotebookApp traits to c.ServerApp.
と書いてあるので,この通りに~/.jupyter
内にあるjupyter_notebook_config.py
を編集
だが治らず.
Extentionの移植¶
ここにはExtentionの移植について書いてある
この通りに自分の場合は
pip3 install jupyter-packaging cookiecutter
In [1]:
#final update
!date '+%b %d %Y (%a)'
5 23 2021 (日)
In [ ]: