This is a copy of an issue I posted on Stack Overflow, but now that I’ve found these forums I’ll repost here.
I’m trying to install Plotly for use within a Jupyter Lab environment using the instructions from Plotly’s web site Instructions. I’m installing on top of a fresh Anaconda 64-bit install on a Windows 10 OS. The following install commands all worked correctly
But when it comes time to do the Jupyter Lab specific stuff then this fails
jupyter labextension install jupyterlab-plotly@4.9.0
An error occured.
ValueError: "jupyterlab-plotly@4.9.0" is not a valid npm package
See the log file for details: C:\Users\tj\AppData\Local\Temp\jupyterlab-debug-cm_yk8nr.log
The log file says the following:
Node v10.13.0
Yarn configuration loaded.
> C:\Users\tj\Anaconda3\npm.CMD pack jupyterlab-plotly@4.9.0
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning SELF_SIGNED_CERT_IN_CHAIN: request to https://registry.npmjs.org/jupyterlab-plotly failed, reason: self signed certificate in certificate chain
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code ETARGET
npm ERR! notarget No matching version found for jupyterlab-plotly@4.9.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\tj\AppData\Roaming\npm-cache\_logs\2020-08-25T14_44_35_633Z-debug.log
So all indications to me are that it thinks it can’t find the nodejs package called jupyterlab-plotly. If I go to the NPM site I can find the package jupyterlab-plotly which indicates it’s version 4.9.0.
It’s not clear to me where I’ve gone wrong. Has anyone successfully followed these steps and gotten plotly to work properly in a Jupyter Lab environment?
still fails in a similar manner with the error message
An error occured.
ValueError: "jupyterlab-plotly@4.10.0" is not a valid npm package
See the log file for details: C:\Users\tj\AppData\Local\Temp\jupyterlab-debug-xbf4irk3.log
and the log file contains info similar to the original one I posted.
which again failed. Looking at it’s debug log things made some progress. It at least found the npm package but when trying to install it we had another issue:
Node v10.13.0
Yarn configuration loaded.
Building jupyterlab assets (build:prod:minimize)
> node C:\Users\tj\Anaconda3\lib\site-packages\jupyterlab\staging\yarn.js install --non-interactive
yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
error Couldn't find package "plotly.js@^1.55.2" required by "jupyterlab-plotly@file:../extensions/jupyterlab-plotly
4.10.0.tgz" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Couldn't find package "@types/plotly.js@1.44.28" required by "jupyterlab-plotly@file:../extensions/jupyterlab-
plotly-4.10.0.tgz" on the "npm" registry.
at C:\Users\tj\Anaconda3\share\jupyter\lab\staging\yarn.js:38113:17
at Generator.throw (<anonymous>)
at step (C:\Users\tj\Anaconda3\share\jupyter\lab\staging\yarn.js:310:30)
at C:\Users\tj\Anaconda3\share\jupyter\lab\staging\yarn.js:323:13
at process._tickCallback (internal/process/next_tick.js:68:7)
npm dependencies failed to install
So it looks like it couldn’t find plotly.js. So I then ran
npm install plotly.js
which looks like it succeeded.
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\tj\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\tj\package.json'
npm WARN tj No description
npm WARN tj No repository field.
npm WARN tj No README data
npm WARN tj No license field.
+ plotly.js@1.55.2
added 453 packages from 166 contributors and audited 454 packages in 30.7s
found 0 vulnerabilities
I have this problem all the time. I have written a read me to help me install plotly on jupyterlab. I’m going to paste it below. Hopefully it will be helpful for you. I don’t usually use an anaconda environment, but I think this should work there as well. I’m on a MAC for what it’s worth.
#####installing plotly for jupyter lab
#check the version of jupyter lab with
jupyter --v #jupyter lab should be > 1.2
#configure the jupyter lab extensions needed to use plotly
#use this to manage out of memory errors
export NODE_OPTIONS=–max-old-space-size=4096 #install the wigest extension
jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build #install the figurewiget
jupyter labextension install plotlywidget@1.5.0 --no-build #rendering support
jupyter labextension install jupyterlab-plotly --no-build #build the extensions
jupyter lab build
This time it worked. The only difference is that instead of being attached to my internal corporate network I was attached via VPN. Apparently there’s a difference in the firewalls. I’ll mark this as closed for now.
Your process worked for me, except that I got an error on the lab build: error icss-utils@5.1.0: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >= 14".
I switched to 12.22.1 (nvm install 12.22.1) and then it worked. Thanks!