【问题标题】:Jupyter lab build fails on fresh Azure Data Science VM (linux)Jupyter 实验室构建在新的 Azure 数据科学 VM (linux) 上失败
【发布时间】:2019-03-12 20:04:14
【问题描述】:

正如标题所说,我创建了一个新的数据科学 VM (Ubuntu),即使仅使用默认的 jupyter hub 扩展,运行 jupyter build 也会失败。

在尝试此之前,我只安装了另外两个包:Azure storage 和用于读取 Parquet 文件的 pyarrow。这些都不应该影响 jupyter。

该配置是一个标准 B4ms 实例,但我尝试了另一个配置,它有同样的问题。

环境是默认的py35 conda env。 Jupyter 未安装在根环境中。
更新 Jupyter 或 jupyter lab 或 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 > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: 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 fsevents@1.2.7: The platform "linux" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@jupyterlab/vdom-extension > @nteract/transform-vdom@1.1.1" 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.

【问题讨论】:

    标签: azure jupyter-notebook azure-virtual-machine


    【解决方案1】:

    我遇到了同样的问题。我通过将 jupyterhub 版本从 0.34.9 更新到 3.5 来修复它:

    conda install jupyterlab=0.35 "ipywidgets>=7.2"
    

    我按照这个链接的解释:JupyterLab Support (Python 3.5+)

    希望它有效!

    【讨论】:

    • 失败了。 Solving environment: failed UnsatisfiableError: The following specifications were found to be in conflict: - azure-storage - jupyterlab=0.35 Use "conda info &lt;package&gt;" to see the dependencies for each package. 运行 conda install -c conda-forge jupyterlab=0.35 "ipywidgets&gt;=7.2" 会导致大量新安装、更新和降级(在“执行事务”阶段有一个错误,pyjwt-1.7.1-py_0)。 ...然后jupyter-lab 构建失败并出现相同的错误:P
    • 是的,有新的安装和降级。我刚刚在一台全新的 Azure Ubuntu ML 机器上对其进行了测试,它工作正常,您是否对您的机器进行了任何更改?
    • 我在尝试升级之前唯一做的事情就是安装 azure storage 和 pyarrow,正如我在问题中所说的那样。否则是一个完全干净的虚拟机。好吧,由于错误消息显示与 azure-storage 冲突,我认为这就是问题所在。我想我又开始使用 jupyter 笔记本了。下次我会在安装 azure-storage 之前先尝试升级 jupyter。
    • 终于在新鲜的 VM 上进行了测试,并且可以正常工作。构建,安装 azure-storage,然后再次构建也可以!与 pyarrow 相同。
    • ....这破坏了 conda 环境,我不得不再次将 env 注册为内核,但现在它可以工作了:P
    【解决方案2】:

    我和你在同一天遇到了类似的问题。 你的 vega-lite 是 3.0.0-rc14 吗?如果是这样,请尝试使用 3.0.0-rc13 并构建:

    首先通过nam安装rc13:

    sudo npm install --prefix /usr/share/jupyter/lab/staging vega-lite@3.0.0-rc13
    

    然后更改目录并构建:

    cd /usr/share/jupyter/lab/staging
    sudo node /usr/lib/python3.4/site-packages/jupyterlab/staging/yarn.js run build:prod
    

    以上解决了我的问题。

    【讨论】:

    • 谢谢,我不得不将目录更改为/anaconda/envs/py35/share/&lt;rest of dir&gt; 而不是usr/share/&lt;rest&gt;usr/lib/... 相同,python3.4 也更改为 python 3.5,安装似乎已经成功,但是构建失败:$ webpack --config webpack.prod.config.js /data/anaconda/envs/py35/share/jupyter/lab/staging/node_modules/webpack-cli/bin/cli.js:231 throw err; ^ Error: Cannot find module '@jupyterlab/hub-extension/package.json' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15) ...etc...
    猜你喜欢
    • 2017-05-28
    • 2021-09-30
    • 1970-01-01
    • 2019-10-31
    • 1970-01-01
    • 2019-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多