AllHack

JupyterLabが起動しない場合の対処法 【M1 Mac】【Conda】

環境

M1 Macbook
MacOS Monterey 12.0 beta 
Conda環境

症状

Jupyterをインストール後Jupyter Labを実行しようとしてもできない。

/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/notebookapp.py:73: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
_("Don't open the notebook in a browser after startup.")
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/notebookapp.py:89: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
_("Allow the notebook to be run from root user.")
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/traits.py:20: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=_('Deprecated: Use minified JS file or not, mainly use during dev to avoid JS recompilation'),
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/traits.py:25: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=_("Supply extra arguments that will be passed to Jinja environment."))
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/traits.py:29: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=_("Extra variables to supply to jinja templates when rendering."),
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/traits.py:62: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=_("""Path to search for custom.js, css""")
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/traits.py:74: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=_("""Extra paths to search for serving jinja templates.
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/traits.py:85: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=_("""extra paths to look for Javascript notebook extensions""")
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/traits.py:130: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=_("""The MathJax.js configuration file that is to be used.""")
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/traits.py:143: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=(_("Dict of Python modules to load as notebook server extensions."
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/notebookapp.py:122: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
description = _("""The Jupyter HTML Notebook.
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/notebookapp.py:143: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=_("""Path to search for custom.js, css""")
/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/notebookapp.py:155: FutureWarning: The alias `_()` will be deprecated. Use `_i18n()` instead.
help=_("""extra paths to look for Javascript notebook extensions""")
[I 2021-09-16 01:18:26.446 ServerApp] jupyterlab | extension was successfully linked.
[W 2021-09-16 01:18:26.589 ServerApp] 'ExtensionManager' object has no attribute '_extensions'
Traceback (most recent call last):
File "/Users/user/miniforge3/envs/web_scraping/bin/jupyter-lab", line 10, in <module>
sys.exit(main())
File "/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/jupyter_server/extension/application.py", line 567, in launch_instance
serverapp = cls.initialize_server(argv=args)
File "/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/jupyter_server/extension/application.py", line 537, in initialize_server
serverapp.initialize(
File "/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/traitlets/config/application.py", line 87, in inner
return method(app, *args, **kwargs)
File "/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/jupyter_server/serverapp.py", line 2310, in initialize
point = self.extension_manager.extension_points[starter_extension]
File "/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/jupyter_server/extension/manager.py", line 303, in extension_points
for value in self.extensions.values()
File "/Users/user/miniforge3/envs/web_scraping/lib/python3.9/site-packages/nbclassic/nbserver.py", line 80, in extensions
nb = self._extensions.get("nbclassic")
AttributeError: 'ExtensionManager' object has no attribute '_extensions' 

解決

nbclassicの最新バージョンをインストールすることで解決。(2021/9/15日時点では0.3.1)

pip install nbclassic==0.3.1

conda環境の場合は、

conda install nbclassic=0.3.1

もしくは

conda install -c conda-forge nbclassic

 

参考

python - Q: Can't start up Jupyter Lab on MacOS - Stack Overflow