New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qgrid install breaks bqplot in jupyterlab #154
Comments
That URL: |
Strangely, using the qgrid extension doesn't trigger that error. Only when you try to use bqplot does it try to fetch that url |
Hmm, I haven't been able to reproduce this yet. I just tested with the following versions and everything seems to be working:
Did you try going through the installation steps again in a new virtual env? Might be worth giving that a shot if you haven't yet. If that doesn't work could you give me the versions of the various packages that you're using, as I did above? Could you also please include the type of OS you're on and the python version you're using as well? Thanks. |
|
@jasongrout I get 2 bundles too which is weird
|
updated to qgrid 1.0.0 and still occurring |
OK, I tried reproducing again using the same versions of the various packages that you're using and I still couldn't reproduce it. Did you try creating a new virtualenv and installing just qgrid and bqplot to confirm that none of the other packages that you have installed are related? My experience with widgets in general has been that starting from scratch with a new virtual env can clear up lots of problems. Also where exactly are you seeing the error you pasted? Is it when you run |
it pops up when you go to use bqplot import bqplot.pyplot as plt
plt.plot([1,2], [3,4])
plt.show() |
python3 -m virtualenv venv
cd venv
. bin/activate
pip3 install jupyterlab bqplot qgrid
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install qgrid
jupyter labextension install bqplot
jupyter lab import qgrid
import bqplot.pyplot as plt
import pandas as pd
qgrid.show_grid(pd.DataFrame())
plt.plot([1,2],[3,4])
plt.show() |
Gotcha, yep I'm seeing the same behavior. qgrid always works even if bqplot is installed but bqplot always stops working as soon as qgrid is installed (and installation order doesn't matter). @jasongrout do you have any thoughts on this? I'm afraid I don't know the internals of the jupyterlab widget machinery well enough to diagnose this. In qgrid I attempted to copy what bqplot was doing in terms of the labextension installation: One thing that looked strange to me while testing this is when I installed bqplot and qgrid was already installed, I'd see log output looks the same as when I install qgrid's webpack: |
They're very complimentary packages so hopefully we can get to the bottom of this. I've been on holiday but now I'll try to dig a bit. |
I think the problem is this line: Line 8 in 84e94f7
That's messing up the jupyterlab webpack machinery. Instead, you should set up the URLs for the classic notebook extension like bqplot does: https://github.com/bloomberg/bqplot/blob/master/js/src/extension.js |
It looks like you already have a corresponding extension.js. It may be enough to just remove the webpack line above. Do you know why it is there? |
Of course, I could have read the comment above it: Lines 5 to 7 in 84e94f7
Do you know if the line is needed after all? It may be best to put that line in a file that is only used in the classic notebook extension bundle, but not in the jlab code. |
It looks like this came from the widget-cookiecutter repository which I used to get started on this version of qgrid: https://github.com/jupyter-widgets/widget-cookiecutter/blob/master/%7B%7Bcookiecutter.github_project_name%7D%7D/js/lib/index.js#L8 |
So I don't really know if it's needed, was just attempting to follow convention. I can try deleting it and see if that fixes things. |
Hmmm, maybe we need to update the cookie cutter... |
That worked @jasongrout, thanks for the help! @timkpaine I've uploaded a beta version to pypi and npm with the fix and confirmed that it works. Install as follows:
I haven't uploaded conda packages for this version yet...hopefully will do an official release soon so I'm going to wait until I do the official release (since the conda build is painfully manual at the moment). |
@TimShawver awesome, will test in a bit |
@TimShawver confirmed working for me |
This fix was included in version 1.0.1 which has now been released. Thanks again for reporting this. |
For details see quantopian/qgrid#154 (comment)
bootstrap 0e08c6e8d1d771f76828:103 GET http://localhost:8888/nullnbextensions/qgrid/0.bundle.js net::ERR_ABORTED
requireEnsure @ bootstrap 0e08c6e8d1d771f76828:103
(anonymous) @ plugin.js:95
exports @ plugin.js:94
WidgetManager.loadClass @ manager.js:143
(anonymous) @ manager-base.js:262
step @ manager-base.js:42
(anonymous) @ manager-base.js:23
(anonymous) @ manager-base.js:17
__awaiter @ manager-base.js:13
ManagerBase._make_model @ manager-base.js:256
(anonymous) @ manager-base.js:246
step @ manager-base.js:42
(anonymous) @ manager-base.js:23
(anonymous) @ manager-base.js:17
__awaiter @ manager-base.js:13
ManagerBase.new_model @ manager-base.js:232
ManagerBase.handle_comm_open @ manager-base.js:144
(anonymous) @ manager.js:82
(anonymous) @ default.js:901
Promise resolved (async)
DefaultKernel._handleCommOpen @ default.js:897
DefaultKernel._onWSMessage @ default.js:729
_ws.onmessage @ default.js:653
manager-base.js:272 Could not instantiate widget
(anonymous) @ manager-base.js:272
step @ manager-base.js:42
(anonymous) @ manager-base.js:23
rejected @ manager-base.js:15
Promise rejected (async)
step @ manager-base.js:16
(anonymous) @ manager-base.js:17
__awaiter @ manager-base.js:13
ManagerBase._make_model @ manager-base.js:256
(anonymous) @ manager-base.js:246
step @ manager-base.js:42
(anonymous) @ manager-base.js:23
(anonymous) @ manager-base.js:17
__awaiter @ manager-base.js:13
ManagerBase.new_model @ manager-base.js:232
ManagerBase.handle_comm_open @ manager-base.js:144
(anonymous) @ manager.js:82
(anonymous) @ default.js:901
Promise resolved (async)
DefaultKernel._handleCommOpen @ default.js:897
DefaultKernel._onWSMessage @ default.js:729
_ws.onmessage @ default.js:653
renderer.js:84 Error displaying widget
renderer.js:85 Error: Loading chunk 0 failed.
at HTMLScriptElement.onScriptComplete (bootstrap 0e08c6e8d1d771f76828:98)
utils.js:119 Error: Could not create a model.
at promiseRejection (utils.js:119)
at
promiseRejection @ utils.js:119
Promise rejected (async)
ManagerBase.handle_comm_open @ manager-base.js:149
(anonymous) @ manager.js:82
(anonymous) @ default.js:901
Promise resolved (async)
DefaultKernel._handleCommOpen @ default.js:897
DefaultKernel._onWSMessage @ default.js:729
_ws.onmessage @ default.js:653
bootstrap 0e08c6e8d1d771f76828:98 Uncaught (in promise) Error: Loading chunk 0 failed.
at HTMLScriptElement.onScriptComplete (bootstrap 0e08c6e8d1d771f76828:98)
onScriptComplete @ bootstrap 0e08c6e8d1d771f76828:98
Promise rejected (async)
ManagerBase.register_model @ manager-base.js:208
(anonymous) @ manager-base.js:247
step @ manager-base.js:42
(anonymous) @ manager-base.js:23
(anonymous) @ manager-base.js:17
__awaiter @ manager-base.js:13
ManagerBase.new_model @ manager-base.js:232
ManagerBase.handle_comm_open @ manager-base.js:144
(anonymous) @ manager.js:82
(anonymous) @ default.js:901
Promise resolved (async)
DefaultKernel._handleCommOpen @ default.js:897
DefaultKernel._onWSMessage @ default.js:729
_ws.onmessage @ default.js:653
bootstrap 0e08c6e8d1d771f76828:98 Uncaught (in promise) Error: Loading chunk 0 failed.
at HTMLScriptElement.onScriptComplete (bootstrap 0e08c6e8d1d771f76828:98)
onScriptComplete @ bootstrap 0e08c6e8d1d771f76828:98
Promise rejected (async)
ManagerBase.handle_comm_open @ manager-base.js:149
(anonymous) @ manager.js:82
(anonymous) @ default.js:901
Promise resolved (async)
DefaultKernel._handleCommOpen @ default.js:897
DefaultKernel._onWSMessage @ default.js:729
_ws.onmessage @ default.js:653
The text was updated successfully, but these errors were encountered: