安装jupyterLab后,启动时报了错。
JupyterLab Error JupyterLab application assets not found in
“/opt/homebrew/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/share/jupyter/lab” Please runjupyter lab build
or use a different app directory
Mac电脑
使用brew安装的python,安装路径是:
/opt/homebrew/Cellar/python@3.10/
brew install python@3.10
安装jupyter
pip3.10 install jupyterlab
启动jupyter
juppyter lab
启动后跳转浏览器页面:http://localhost:8888/lab?token=36c728a3b3c42a882a0255378b72515aae134c2252927f54
页面提示了文章开头的错误。
按照错误提示执行了
jupyter lab build
也报错了,报错内容如下:
➜ ~ jupyter lab build [LabBuildApp] JupyterLab 4.0.3 [LabBuildApp]
Building in
/opt/homebrew/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/share/jupyter/lab
[LabBuildApp] ERROR | Build failed. Troubleshooting: If the build
failed due to an out-of-memory error, you may be able to fix it by
disabling thedev_build
and/orminimize
options.If you are building via the
jupyter lab build
command, you can
disable these options like so:jupyter lab build --dev-build=False --minimize=False
You can also disable these options for all JupyterLab builds by adding
these lines to a Jupyter config file namedjupyter_config.py
:c.LabBuildApp.minimize = False c.LabBuildApp.dev_build = False
If you don’t already have a
jupyter_config.py
file, you can create
one by adding a blank file of that name to any of the Jupyter config
directories. The config directories can be listed by running:jupyter --paths
Explanation:
dev-build
: This option controls whether adev
or a more streamlinedproduction
build is used. This option will default to
False
(i.e., theproduction
build) for most users. However, if you
have any labextensions installed from local files, this option will
instead default toTrue
. Explicitly settingdev-build
toFalse
will ensure that theproduction
build is used in all circumstances.
minimize
: This option controls whether your JS bundle is minified during the Webpack build, which helps to improve JupyterLab’s overall
performance. However, the minifier plugin used by Webpack is very
memory intensive, so turning it off may help the build finish
successfully in low-memory environments./opt/homebrew/lib/python3.10/site-packages/jupyterlab/debuglog.py:56:
UserWarning: An error occurred. warnings.warn(“An error occurred.”)
/opt/homebrew/lib/python3.10/site-packages/jupyterlab/debuglog.py:57:
UserWarning: ValueError: Please install nodejs >=18.0.0 before
continuing. nodejs may be installed using conda or directly from the
nodejs website. warnings.warn(msg[-1].strip())
/opt/homebrew/lib/python3.10/site-packages/jupyterlab/debuglog.py:58:
UserWarning: See the log file for details:
/var/folders/8r/7zz_4hnn5fx317wqp8ksjxq40000gn/T/jupyterlab-debug-jjnjl2_q.log
warnings.warn(f"See the log file for details: {log_path!s}")
错误提示里说Please install nodejs >=18.0.0 before continuing
切换nodejs大于等于18的版本或者安装一个18以上的版本之后
再执行jupyter lab build
就成功了
➜ ~ jupyter lab build
[LabBuildApp] JupyterLab 4.0.3 [LabBuildApp] Building in
/opt/homebrew/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/share/jupyter/lab
[LabBuildApp] Building jupyterlab assets (production, minimized)