Jupyter 实验室无法安装任何扩展:断言"数据"失败



我尝试安装@jupyter-widgets/jupyterlab-manager:

Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details:  /tmp/jupyterlab-debug-vs3sn2l7.log

其他扩展也无法安装,并给出相同的错误。从web客户端安装会产生500个错误。

我在谷歌上搜索过,但找不到同样的错误。此外,类似错误的解决方案似乎都不起作用。

我的环境:

Raspbian GNU/Linux 10 (buster)
$ node --version
v10.15.2
$ python3 -V
Python 3.7.3
$ jupyter --version
jupyter core     : 4.6.1
jupyter-notebook : 6.0.2
qtconsole        : 4.6.0
ipython          : 7.11.1
ipykernel        : 5.1.3
jupyter client   : 5.3.4
jupyter lab      : 1.2.6
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.3
traitlets        : 4.3.3
$ which jupyter
/usr/local/bin/jupyter

这是日志文件:

Yarn configuration loaded.
Node v10.15.2
> /usr/local/bin/npm pack @jupyter-widgets/jupyterlab-manager
npm notice 
npm notice 📦  @jupyter-widgets/jupyterlab-manager@1.1.0
npm notice === Tarball Contents === 
npm notice 2.3kB  package.json        
npm notice 1.5kB  LICENSE             
npm notice 1.9kB  README.md           
npm notice 277B   lib/index.d.ts      
npm notice 380B   lib/index.js        
npm notice 5.9kB  lib/manager.d.ts    
npm notice 14.5kB lib/manager.js      
npm notice 1.9kB  lib/output.d.ts     
npm notice 5.2kB  lib/output.js       
npm notice 830B   lib/plugin.d.ts     
npm notice 7.8kB  lib/plugin.js       
npm notice 956B   lib/renderer.d.ts   
npm notice 3.3kB  lib/renderer.js     
npm notice 216B   lib/semvercache.d.ts
npm notice 862B   lib/semvercache.js  
npm notice 375B   schema/plugin.json  
npm notice === Tarball Details === 
npm notice name:          @jupyter-widgets/jupyterlab-manager         
npm notice version:       1.1.0                                       
npm notice filename:      jupyter-widgets-jupyterlab-manager-1.1.0.tgz
npm notice package size:  12.2 kB                                     
npm notice unpacked size: 48.3 kB                                     
npm notice shasum:        6196b9e3df314d488180fb5ed3bfb11df2dfdeaf    
npm notice integrity:     sha512-2dKdzl43nMvmr[...]53y1/ADuNbzhg==    
npm notice total files:   16                                          
npm notice 
jupyter-widgets-jupyterlab-manager-1.1.0.tgz
Yarn configuration loaded.
Node v10.15.2
Building jupyterlab assets (build:prod:minimize)
> node /usr/local/lib/python3.7/dist-packages/jupyterlab/staging/yarn.js install --non-interactive
yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.11: The platform "linux" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
success Saved lockfile.
Done in 49.55s.
> node /usr/local/lib/python3.7/dist-packages/jupyterlab/staging/yarn.js yarn-deduplicate -s fewer
yarn run v1.15.2
$ /usr/local/share/jupyter/lab/staging/node_modules/.bin/yarn-deduplicate -s fewer
Done in 15.72s.
> node /usr/local/lib/python3.7/dist-packages/jupyterlab/staging/yarn.js run build:prod:minimize
yarn run v1.15.2
$ ensure-max-old-space webpack --config webpack.prod.minimize.config.js
/usr/bin/node[26503]: ../src/node_platform.cc:414:std::shared_ptr<node::PerIsolatePlatformData> node::NodePlatform::ForIsolate(v8::Isolate*): Assertion `data' failed.
child_process.js:637
throw err;
^
Error: Command failed: /usr/local/share/jupyter/lab/staging/node_modules/.bin/webpack --config webpack.prod.minimize.config.js
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at Object.<anonymous> (/usr/local/share/jupyter/lab/staging/node_modules/@jupyterlab/buildutils/lib/ensure-max-old-space.js:38:17)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
JupyterLab failed to build
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/jupyterlab/debuglog.py", line 47, in debug_logging
yield
File "/usr/local/lib/python3.7/dist-packages/jupyterlab/labextensions.py", line 105, in start
command=command, app_options=app_options)
File "/usr/local/lib/python3.7/dist-packages/jupyterlab/commands.py", line 459, in build
command=command, clean_staging=clean_staging)
File "/usr/local/lib/python3.7/dist-packages/jupyterlab/commands.py", line 669, in build
raise RuntimeError(msg)
RuntimeError: JupyterLab failed to build
Exiting application: jupyter

JupyterLab 1.x在构建前检查内存大小(ensure-max-old-space行(,默认值为4GB。由于我使用的是树莓派,内存没有达到这个要求。这就是断言失败的原因。

但是JupyterLab 2.0.0改变了这种行为,因为Node 12+处理内存。(变更日志,PR(。在将交换大小更改为1000 MB(我认为500 MB就足够了(后,我成功地用Node v10.15.2构建了JupyterLab 2.0.1。

然而JupyterLab 2.1.0恢复了该PR以再次支持Node 10+。

要绕过小于4 GB内存的检查,您可以:

  • 安装jupyterlab>=2.0.0,<2.1.0
  • 或者在构建时设置环境变量CCD_ 4。您可能需要根据系统将2048更改为适当的MB内存。此选项是在1.2.0之后添加的

并确保您有足够的内存来构建:(

最新更新