plotly.py: Jupyter Lab extensions fail to build
I am attempting to install Plotly extensions to the Jupyter Lab environment as described in the “JupyterLab Support (Python 3.5+)” instructions here.
Whenever I attempt a build, or a jupyterlab extension install ...
without the --nobuild
option, installation fails. The trouble comes from npm
, but I cannot find any information about this error.
error Couldn't find any versions for "@types/d3" that matches "^[object Object]"
For more information on the problem, this is the result of an attempted build:
$ jupyter lab build
[LabBuildApp] JupyterLab 1.2.6
[LabBuildApp] Building in /usr/local/share/jupyter/lab
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: npm dependencies failed to install
See the log file for details: ...
These are the contents of the log file:
[LabBuildApp] Building in /usr/local/share/jupyter/lab
[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Node v13.8.0
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] > node /usr/local/lib/python3.7/site-packages/jupyterlab/staging/yarn.js install --non-interactive
[LabBuildApp] yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
warning jupyterlab-plotly > plotly.js > regl-splom > left-pad@1.3.0: use String.prototype.padStart()
warning jupyterlab-plotly > plotly.js > regl-error2d > bubleify > buble > os-homedir@2.0.0: This is not needed anymore. Use `require('os').homedir()` instead.
error Couldn't find any versions for "@types/d3" that matches "^[object Object]"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[LabBuildApp] npm dependencies failed to install
...
I successfully installed plotly and d3 with npm
.
I am running Python 3.7.6, Jupyter Lab 1.2.6, IPyWidgets 7.5.1, Yarn 1.22.0, and Node 13.8.0.
All Python packages were installed using pip
.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 11
- Comments: 30 (12 by maintainers)
OK I’ve pushed up versions 1.5.2 of the extensions, so that should resolve the current issue!
The root cause of this problem appears to be a bad version of https://www.npmjs.com/package/@types/plotly.js which is something we depend on but do not maintain.
In principle I could just pin the version to a known-working one here: https://github.com/plotly/plotly.py/blob/master/packages/javascript/jupyterlab-plotly/package.json#L35 and release versions 1.5.2 of our extensions. I will try to do this tonight (Pacific Time).
Thanks for your quick work on this. I followed the instructions here again, changing all
@1.5.1
references to@1.5.2
and the installation and build worked perfectly.@peterblazejewicz yes, thanks, your comment above pointed the way. I rather wish that the
types
project did a bit more QA on stuff like this 😉Extremely helpful, thank you @matdecac ! This error doesn’t have the same cause as the one I have previously encountered, so I will have to investigate more fully next week.
If anyone else encounters an installation problem, please continue to provide similar details so I can determine if we have one or many issues to tackle 😃
OK I think I have enough info to fix this, I should have a fix in a day or two, thanks for the information everyone!
Hi, I have the same issue. It appeared suddenly. Two days ago, build was successful. Today, I created a new conda env (copy from a environment.yml with the exact same packages) and it fails. Here is the output of
jupyter labextension list
and the log file