Did you follow all of the installation instructions in the README at https://github.com/plotly/plotly.py? There are several packages with particular versions that you need to get FigureWidget working.
Could not instantiate widget
Error: Could not create a model.
Uncaught (in promise) Module plotlywidget, semver range ^0.1.1 is not registered as a widget module
Error displaying widget
//
Result of jupyter labextension list:
JupyterLab v0.32.1
Known labextensions:
app dir: /home/ddsadm/virtualenvs/jupyter/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager
@jupyter-widgets/jupyterlab-manager v0.35.0 enabled OK
@jupyterlab/plotly-extension
@jupyterlab/plotly-extension v0.16.0 enabled OK
ipyvolume
ipyvolume v0.4.6 enabled OK
jupyter-matplotlib
jupyter-matplotlib v0.3.0 enabled OK
plotlywidget
plotlywidget v0.2.0 enabled OK
It looks like youâre version of plotly (python) and plotlywidget (JupyterLab) are out of sync. Upgrade plotly.py to 3.1.0 (which corresponds to plotlywidget version 0.2.0 which you already have).
The versions numbers between the python library and the JupyterLab extensions have to line up (they are specified in the README), and unfortunately thereâs not a way to enforce that the Python and JupyterLab packages do this automatically.
For the plotly FigureWidget support you need the plotly (Python) and plotlywidget (JavaScript) versions to line up according to our README/changelog (currently 3.1.0 and 0.2.0 respectively).
The @jupyterlab/plotly-extension (JavaScript) extension is needed for offline iplot support. This shouldnât need to be updated as frequently.
jupyter labextensions list
JupyterLab v0.32.1
Known labextensions:
app dir: c:\programdata\anaconda3\envs\data_science2\share\jupyter\lab @jupyter-widgets/jupyterlab-manager @jupyter-widgets/jupyterlab-manager v0.35.0 enabled ok
plotlywidget
plotlywidget v0.2.0 enabled ok
If youâre still struggling with this, could you include your updated browser error message? The packages you have installed look good, but if you still have an error Iâd like to see what widget version itâs complaining about.
A couple of thoughts. Are you able to display non-plotly ipywidgets? For example, do you see a slider when you run this code?
import ipywidgets
ipywidgets.IntSlider()
Another thought: I think I remember hitting a 404 error at one point (across all ipywidgets) when had a an adblock extension update. So if you have an adblock extension make sure to whitelist localhost. Also try it in multiple browsers (at least chrome and firefox), and make sure the browser versions are up to date.
Sorry, I know this is a scattershot of suggestions. Thanks for sticking with it!
-Jon
Hi, I am getting similar error as vhphan and not sure how to fix it since I thought I have matched all the versions.
here is what I have:
JupyterLab v0.35.3
Known labextensions:
app dir: C:\Users\snamnaba\AppData\Local\Continuum\anaconda3\share\jupyter\lab @jupyter-widgets/jupyterlab-manager v0.38.1 enabled ok @jupyterlab/plotly-extension v0.18.2 enabled ok @jupyterlab/statusbar v0.5.0 enabled ok @jupyterlab/toc v0.6.0 enabled ok @jupyterlab/xkcd-extension v0.6.0 enabled ok
jupyterlab-chart-editor v1.0.0 enabled ok
jupyterlab-flake8 v0.2.4 enabled ok
jupyterlab-python-file v0.2.0 enabled ok
plotlywidget v0.8.0 enabled ok
Build recommended, please run jupyter lab build:
plotlywidget needs to be included in build
jupyterlab-chart-editor needs to be included in build @jupyterlab/plotly-extension changed from file:âŚ/extensions/jupyterlab-plotly-extension-0.18.1.tgz to file:âŚ/extensions/jupyterlab-plotly-extension-0.18.2.tgz
(base) C:\Users\snamnaba>jupyter lab build
[LabBuildApp] JupyterLab 0.35.3
[LabBuildApp] Cleaning C:\Users\snamnaba\AppData\Local\Continuum\anaconda3\share\jupyter\lab
Cleaning C:\Users\snamnaba\AppData\Local\Continuum\anaconda3\share\jupyter\labâŚ
Success!
[LabBuildApp] Building in C:\Users\snamnaba\AppData\Local\Continuum\anaconda3\share\jupyter\lab
[LabBuildApp] Node v10.13.0
[LabBuildApp] > node C:\Users\snamnaba\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\staging\yarn.js install
yarn install v1.9.4
info No lockfile found.
[1/5] Validating package.jsonâŚ
[2/5] Resolving packagesâŚ
warning jupyterlab-chart-editor > react-chart-editor > plotly.js > mapbox-gl > @mapbox/gl-matrix@0.0.1: This
warning jupyterlab-chart-editor > react-chart-editor > plotly.js > ndarray-fill > cwise > static-module > through2 > xtend > object-keys@0.4.0:
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.
[3/5] Fetching packagesâŚ
[-------------------------------------------------------------------------------------------------------------------------------------] 0/1345(node:11204) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
info There appears to be trouble with your network connection. RetryingâŚ
info There appears to be trouble with your network connection. RetryingâŚ
info There appears to be trouble with your network connection. RetryingâŚ
info There appears to be trouble with your network connection. RetryingâŚ
info There appears to be trouble with your network connection. RetryingâŚ
info There appears to be trouble with your network connection. RetryingâŚ
error An unexpected error occurred: âhttps://registry.yarnpkg.com/mdi-react/-/mdi-react-3.4.0.tgz: ESOCKETTIMEDOUTâ.
info If you think this is a bug, please open a bug report with the information provided in âC:\Users\snamnaba\AppData\Local\Continuum\anaconda3\share\jupyter\lab\staging\yarn-error.logâ.
info Visit https ://yarnpkg.com/en/docs/cli/install for documentation about this command.
info There appears to be trouble with your network connection. RetryingâŚ
info There appears to be trouble with your network connection. RetryingâŚ
[LabBuildApp] > node C:\Users\snamnaba\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\staging\yarn.js run build
yarn run v1.9.4
$ webpack
âwebpackâ is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.
yes I do have access to the internet at all times when I tried to build Jupyterlab. Though I donât know why it always give that error. I also tried cloning my environment and rebuild jupyter lab but still faced same issue.