JupyterLab Error

用户在Mac上使用brew安装python3.10并安装jupyterlab后启动时遇到错误,提示JupyterLab应用资产未找到。尝试执行jupyterlabbuild命令进行构建也失败,错误指出需要nodejs版本大于等于18.0.0。升级nodejs到适当版本后,jupyterlabbuild成功构建jupyterlab的生产环境和最小化资产。
摘要由CSDN通过智能技术生成

安装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 run jupyter 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 the dev_build and/or minimize 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 named jupyter_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 a dev or a more streamlined production build is used. This option will default to
    False (i.e., the production build) for most users. However, if you
    have any labextensions installed from local files, this option will
    instead default to True. Explicitly setting dev-build to False
    will ensure that the production 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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值