正如标题所说,我创建了一个新的数据Science VM(Ubuntu),即使只使用默认的jupyter hub扩展,运行jupyter build
也会失败。
在尝试此操作之前,我只安装了另外两个软件包:Azure存储和用于读取Parquet文件的pyarrow。这些都不应该影响jupyter。
配置是标准B4ms实例,但我尝试了另一种配置,它有同样的问题。
环境是默认的py35 conda env。 Jupyter没有安装在root环境中。 更新Jupyter或jupyter实验室或ipython没有帮助。
这是完整的输出:
(py35) user@VM:~$ jupyter lab build
[LabBuildApp] JupyterLab 0.34.12
[LabBuildApp] Building in /data/anaconda/envs/py35/share/jupyter/lab
[LabBuildApp] > node /data/anaconda/envs/py35/lib/python3.5/site-packages/jupyterlab/staging/yarn.js install
yarn install v1.9.4
info No lockfile found.
[1/4] Resolving packages...
warning css-loader > cssnano > autoprefixer > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > caniuse-api > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[2/4] Fetching packages...
[------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0/822(node:4101) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@jupyterlab/vdom-extension > @nteract/[email protected]" has incorrect peer dependency "react@^15.6.1".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 30.67s.
[LabBuildApp] > node /data/anaconda/envs/py35/lib/python3.5/site-packages/jupyterlab/staging/yarn.js run build
yarn run v1.9.4
$ webpack
ModuleNotFoundError: Module not found: Error: Can't resolve 'vega' in '/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/build/src/compile'
at factory.create (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/webpack/lib/Compilation.js:535:10)
at factory (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:397:22)
at resolver (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:130:21)
at asyncLib.parallel (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:224:22)
at /data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/neo-async/async.js:2825:7
at /data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/neo-async/async.js:6886:13
at normalResolver.resolve (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/webpack/lib/NormalModuleFactory.js:214:25)
at doResolve (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:184:12)
at hook.callAsync (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
at _fn0 (eval at create (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
at resolver.doResolve (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:37:5)
at hook.callAsync (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
at _fn0 (eval at create (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
at hook.callAsync (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
at _fn0 (eval at create (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:12:1)
at resolver.doResolve (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:42:38)
at hook.callAsync (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
at _fn41 (eval at create (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:381:1)
at resolver.doResolve (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js:23:37)
at hook.callAsync (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
at _fn0 (eval at create (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
at hook.callAsync (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
at _fn0 (eval at create (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
at args (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/forEachBail.js:30:14)
at hook.callAsync (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
at _fn0 (eval at create (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
at resolver.doResolve (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:37:5)
at hook.callAsync (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
at _fn0 (eval at create (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
at hook.callAsync (/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/enhanced-resolve/lib/Resolver.js:238:5)
resolve 'vega' in '/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/build/src/compile'
Parsed request is a module
using description file: /data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/build/package.json (relative path: ./src/compile)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/build/src/compile/node_modules doesn't exist or is not a directory
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/build/src/node_modules doesn't exist or is not a directory
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/build/node_modules doesn't exist or is not a directory
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/node_modules doesn't exist or is not a directory
/data/anaconda/envs/py35/share/jupyter/lab/node_modules doesn't exist or is not a directory
/data/anaconda/envs/py35/share/jupyter/node_modules doesn't exist or is not a directory
/data/anaconda/envs/py35/share/node_modules doesn't exist or is not a directory
/data/anaconda/envs/py35/node_modules doesn't exist or is not a directory
/data/anaconda/envs/node_modules doesn't exist or is not a directory
/data/anaconda/node_modules doesn't exist or is not a directory
/data/node_modules doesn't exist or is not a directory
/node_modules doesn't exist or is not a directory
looking for modules in /data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/node_modules
using description file: /data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
looking for modules in /data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules
using description file: /data/anaconda/envs/py35/share/jupyter/lab/staging/package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
using description file: /data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/package.json (relative path: ./node_modules/vega)
no extension
Field 'browser' doesn't contain a valid alias configuration
using description file: /data/anaconda/envs/py35/share/jupyter/lab/staging/package.json (relative path: ./node_modules/vega)
no extension
Field 'browser' doesn't contain a valid alias configuration
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/node_modules/vega doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/node_modules/vega.wasm doesn't exist
.mjs
Field 'browser' doesn't contain a valid alias configuration
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega.wasm doesn't exist
.mjs
Field 'browser' doesn't contain a valid alias configuration
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/node_modules/vega.mjs doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega.mjs doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/node_modules/vega.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/node_modules/vega.json doesn't exist
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega.json doesn't exist
as directory
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega-lite/node_modules/vega doesn't exist
as directory
/data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/vega doesn't exist
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我有同样的问题。我通过将jupyterhub版本从0.34.9更新到3.5来修复它:
conda install jupyterlab=0.35 "ipywidgets>=7.2"
我使用以下链接进行了解释:JupyterLab Support (Python 3.5+)
希望它有效!
我和你的同一天有类似的问题。你的vega-lite 3.0.0-rc14?如果是这样,请尝试使用3.0.0-rc13并构建:
首先通过nam安装rc13:
sudo npm install --prefix /usr/share/jupyter/lab/staging [email protected]
然后更改目录并构建:
cd /usr/share/jupyter/lab/staging
sudo node /usr/lib/python3.4/site-packages/jupyterlab/staging/yarn.js run build:prod
以上解决了我的问题。