Giter VIP home page Giter VIP logo

Comments (16)

Lefort-Antoine avatar Lefort-Antoine commented on July 18, 2024 1

I have the exactly same issue.

Functions call by clicking on "Export" toolbar are : display_html and display_javascript
while show_grid call function display

any idea ? thanks

from qgrid.

stvogel avatar stvogel commented on July 18, 2024 1

Great! This worked for me. Thanks.

from qgrid.

JohnOmernik avatar JohnOmernik commented on July 18, 2024 1

Ok, walking through all of that got working. So for Jupyterhub, the trick is to use remote_js=True (and ensure things aren't cached).

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

Thanks for the detailed report. I haven't tried qgrid with jupyterhub yet, but based on what I'm reading online, it seems widgets that work with jupyter notebook should also work on jupyterhub. Did you happen to try any other widgets to see if you could get them working? If other widgets are working and qgrid is the only widget that's not then there's probably a bug I need to fix.

If you're not able to get widgets working with jupyterhub at all, this thread might be helpful: https://groups.google.com/forum/#!topic/jupyter/n-GI5uNuHNU

from qgrid.

rushtehrani avatar rushtehrani commented on July 18, 2024

I haven't dug in but I suspect this is happening because assets are always being loaded from /nbextensions vs NotebookApp.base_url + /nbextensions

from qgrid.

lengau avatar lengau commented on July 18, 2024

I suspect that @rushtehrani is correct. This is happening for us on multiple JupyterHub servers and it only affects qgrid.

from qgrid.

stvogel avatar stvogel commented on July 18, 2024

I got exactly the same problem when running with jupyterhub.
All other widgets are working. And I definitely have the same python running.
The error is
https://xxx/hub/nbextensions/qgridjs/lib/slick.grid.css Failed to load resource: the server responded with a status of 404 (Not Found)
and the same for all .js ..
Somehow the path "/hub/nbextensions" seems strange to me.
And qgrid is installed globaly unter /usr/share/jupyter/nbextensions/qgridjs

Is there a workaround to correct the url-path? It sounds easy to fix, but I don't know where to do that.

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

Thanks for all the info. I was able to reproduce this, and I'm working on a fix for it. I don't have a quick fix in mind but I have another larger project in progress that I know will fix it. Basically I'm going to update the packaging/deployment so that it behaves just like other widgets, which will also make it work in jupyterhub.

In the meantime you can get around this issue by setting the remote_js option to True before attempting to call show_grid in your notebook. If you've already called show_grid with remote_js set to it's default value of false, you may need to clear all cell output and refresh the page (using your browser's refresh button) for this workaround to take effect.

Since you'll always want remote_js to be True, the easiest way to do this is probably to execute qgrid.set_defaults(remote_js=True) in any notebook in which you want to use qgrid. You can also pass this option into the show_grid function itself, as described in the docs here: http://qgrid.readthedocs.io/en/latest/#qgrid.show_grid

from qgrid.

JohnOmernik avatar JohnOmernik commented on July 18, 2024

I am (I think( running into this issue. I am running Jupyter via Jupyter hub and I all I get when I do show grid is a little X where the widgets go. I tried the remote_js and it's still not working here... where should I look for logs that can help me troubleshoot? My jupyter notebook server doesn't having any glaring entries that concern me...

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

@JohnOmernik if you open up your browser's developer tools (on Chrome and OS X it's under View -> Developer -> Developer Tools) and then click on the Console tab you might see some errors there that could help us diagnose the issue.

from qgrid.

JohnOmernik avatar JohnOmernik commented on July 18, 2024

So I see a request for

https://jupyterhub-mainhub-prod.marathon.slave.mesos:22443/hub/nbextensions/qgridjs/lib/slick.grid.css

Which I get a 302 found with a location of /hub/nbextensions/qgridjs/lib/slick.grid.css

Which then I get a not found (404) request for: https://jupyterhub-mainhub-prod.marathon.slave.mesos:22443/hub/nbextensions/qgridjs/lib/slick.grid.css 404

(Also for qgrid.css) Does that help?

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

Yea that's helpful. It seems like the remote_js=True setting has not taken effect in your notebook. I would expect qgrid to be attempting to load those css files from https://cdn.rawgit.com/quantopian/qgrid/ if remote_js=True was working. I think maybe what's happening is you have another cell in your notebook where rendering qgrid failed, and the output from that cell is saved with your notebook. To clear that cell output, and make sure it's javascript doesn't run again you can try the following steps:

  1. In the notebook menu, clear all cell output:
    screen shot 2017-07-05 at 12 23 17 pm
  2. Save the notebook (with all your cell output cleared).
  3. Click the refresh button on your browser to refresh the page.
  4. Before attempting to call qgrid.show_grid, execute a cell with qgrid.set_defaults(remote_js=True)
  5. Now try and render your qgrid with a call to show_grid or by constructing a QGridWidget directly and displaying it.

If that doesn't work it might be that your browser is doing some aggressive caching so you might try disabling caching in your browser temporarily while you're going through these steps. Normally the way I do this is by enabling Disable cache (while DevTools is open) in the settings for Chrome's dev tools, and then leaving the dev tools panel open while I'm troubleshooting.

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

Yea that's the situation for now. The next release I'm working on will eliminate the need for this workaround.

from qgrid.

hbensalem avatar hbensalem commented on July 18, 2024

Hi,
I have the same problem with JupyterHub. No errors but the grid doesn't show.
Unfortunqtely using qgrid.set_defaults(remote_js=True) did not solve the problem. Any other suggestions ?
Thanks !

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

@hbensalem I just discovered that qgrid is not working with ipywidgets 7.x (it only works with 6.x). I have a new branch of qgrid that will work with 7.x, and I'll likely merge it soon in light of this discovery.

Could you check your version of ipywidgets, and if it's 7, try using 6 instead if possible?

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

This is fixed in qgrid 1.0, which is currently available in beta form. See the installation instructions on the updated readme page.

To use qgrid with Jupyterhub, simply install it according to the installation instructions on the readme in the same environment where you're running Jupyterhub. The special steps I've listed above should now be unnecessary.

from qgrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.