Giter VIP home page Giter VIP logo

Comments (17)

keluc avatar keluc commented on July 18, 2024 2

I had the same problem when working with anaconda (after conda install qgrid). Finally I succeeded to get it working in anaconda as follows:

  • I moved the folders created by qgrid.nbinstall to the anaconda folder ... \share\jupyter\nbextensions
  • I had to conda install ipywidgets
    After this the qgrid appeared. I tried to look into the qgrid.nbinstall function, but at first glance it was not clear to me what should be changed.

from qgrid.

emgong avatar emgong commented on July 18, 2024 1

Same problem here - the problem was resolved by reloading the notebook - not sure what the issue was

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

I don't know what those errors mean, but I would suggest looking at the sample notebook on nbviewer to see how qgrid is used. Two things that I see missing:

  1. You need to run nb_install to install the widget to your local jupyter notebook instance
  2. You need to call show_grid to actually render the DataFrame. Qgrid doesn't automatically take over DataFrame rendering, it has to be told explicitly via a call to show_grid.

To get the sample notebook running locally, clone the repository using
git clone https://github.com/quantopian/qgrid.git
and then follow the steps in the section Running the Demo Locally. Apologies if the docs are confusing, I'm going to try to clean them up a bit.

from qgrid.

jmerkow avatar jmerkow commented on July 18, 2024

Ooops I think I copied the wrong python code. How silly of me. This is the code I am using:

import qgrid

qgrid.nbinstall(overwrite=True)  # copies javascript dependencies to your /nbextensions folder
qgrid.set_defaults(remote_js=True)
import pandas as pd
import numpy as np
randn = np.random.randn

# Set this pandas option to prevent the grid from being too big
pd.set_option('display.max_rows', 8)

# Get a pandas DataFrame containing the daily prices for the S&P 500 from 1/1/2011 - 1/1/2014
from pandas.io.data import get_data_yahoo
spy = get_data_yahoo(
    symbols='SPY',  
    start=pd.Timestamp('2011-01-01'),  
    end=pd.Timestamp('2014-01-01'),
    adjust_price=True,
)
qgrid.show_grid(spy)

from qgrid.

jmerkow avatar jmerkow commented on July 18, 2024

Where specifically is nbinstall supposed to copy the extension to?

from qgrid.

djchou avatar djchou commented on July 18, 2024

Your code worked for me. What version of qgrid / pandas are you using?

from qgrid.

jmerkow avatar jmerkow commented on July 18, 2024

So, I no longer use the machine I had this issue on. I tried it on my new machine, (also with safari instead of chrome) and worked fine.
If I run into trouble again, I will update, but for now I will close this issue.

from qgrid.

cschwem2er avatar cschwem2er commented on July 18, 2024

Unfortunately I have the same issue and used exactly the instructions from the example notebook. Is there a way to debug this? And what information would you need? Browser, packages, etc?

Edit: I think copying the data to my local folder does not work, because I can't find any files there. After calling qgrid.nbinstall with user=False (from the console with admin rights), files get copied to /usr/local/share/jupyter/nbextensions/qgridjs. Still, no qgrids are shown in my notebooks.

Edit2: Heres the output from my browser console:

GET http://localhost:8888/static/jupyter-js-widgets.js?v=20160710154640 404 (Not Found)
Couldn't create a view for model id '2c1ebeed169549afaccc5570dfebaa5e'  --  Error: Script error for "jupyter-js-widgets", needed by: nbextensions/qgridjs/qgrid.widget(…)
Could not create view  --  WrappedError {stack: "Error: Couldn't create a view for model id '2c1ebe…n.js?v=dda91b55a04855a1c133b176c7a48905:12878:33↵", message: "Couldn't create a view for model id '2c1ebeed169549afaccc5570dfebaa5e'", error_stack: Array[3]}
Could not display model  --  WrappedError {stack: "Error: Could not create view↵  at new Error (nativ…n.js?v=dda91b55a04855a1c133b176c7a48905:12878:33↵", message: "Could not create view", error_stack: Array[4]}
Uncaught (in promise) WrappedError {stack: "Error: Couldn't create a view for model id '2c1ebe…n.js?v=dda91b55a04855a1c133b176c7a48905:12878:33↵", message: "Couldn't create a view for model id '2c1ebeed169549afaccc5570dfebaa5e'", error_stack: Array[4]}
Uncaught (in promise) WrappedError {stack: "Error: Could not display model↵  at new Error (nat…n.js?v=dda91b55a04855a1c133b176c7a48905:12878:33↵", message: "Could not display model", error_stack: Array[4]}

from qgrid.

brycepg avatar brycepg commented on July 18, 2024

I had trouble finding the qgrid extension location.

It's located in ~/.local if you did pip install --user qgrid

Copying the files like @keluc noted fixed this issue for me (I'm also using anaconda):

 cp -r ~/.local/share/jupyter/nbextensions/qgridjs/ ~/anaconda3/share/jupyter/nbextensions/

Thanks!

from qgrid.

TimShawver avatar TimShawver commented on July 18, 2024

In case anyone is still seeing this issue, please try installing the new qgrid 1.0 beta using the instructions here: https://github.com/quantopian/qgrid#installation. As you'll see in those instructions, the nbinstall step that appears to be an issue for some people is no longer required. This is because qgrid 1.0 follows the recommended installation/deployment guidelines provided by the ipywidgets team.

Only caveat for using qgrid 1.0 is that you need to be using ipywidgets version 7.x or newer.

from qgrid.

robinkiplangat avatar robinkiplangat commented on July 18, 2024

I have qgrid installed via conda install qgrid but in the notebook, I get no response with;
import qgrid
qgrid.show_grid(df)
are there other steps that I need to take beyond importing it?
There are no errors when the cell is executed. My details are:

Operating System: Mac OS High Sierra
Browser: Firefox
Python Version: Python 3.6.3
How did you install Qgrid: conda
Notebook version: 5.0.0
ipywidgets version: 7.1.2
qgrid version: 1.0.1

from qgrid.

sshixu avatar sshixu commented on July 18, 2024

Upgrading to the latest browser may solve the issue.

from qgrid.

markfink avatar markfink commented on July 18, 2024

I tried to get it going on a simple sample but no luck so far...
image

I used pip for installation on python3. qgrid==1.0.2
chrome: Version 62.0.3202.94 (Official Build) (64-bit)
running on uptodate arch linux... (hope qgrid is not Windows only)

from qgrid.

manik-agg avatar manik-agg commented on July 18, 2024

@markfink : Hey i am having the same problem with exaclty the same code but I am using Windows version. Were you able to rectify the same.

from qgrid.

graphedge avatar graphedge commented on July 18, 2024

All, I have had some challenges on WinPy 3.6.7 / newer Chome / Notebook / fresh install of qgrid and samples today, but it's partly functional. I don't see any toolbars.

Two suggestions for users:

  1. My dfs only show up after qgrid_widget.get_changed_df(), not before. This only works in a second cell after the cell where show_grid runs.
  2. See if your notebook says "Untrusted" on the top right or if you have any messages like the one below in your cli:

[W 09:03:28.306 LabApp] Notebook winpyfolder/folder/mynotebook.ipynb is not trusted

If you do and only if you trust the notebook author, click trust on the top right of the notebook. Specifically you may need to click untrusted and then trust.

from qgrid.

jkmgeo avatar jkmgeo commented on July 18, 2024

@brettbrocato to see the df's, be sure you're saving the widget to a variable, and then calling that variable so it's shown in the output cell; this got my for the longest time.

import qgrid
qgrid_widget = qgrid.show_grid(df)
qgrid_widget # omitting this line saves the widget to a variable but it won't show

Apologies if you already knew this - just thought I'd place this here for anyone new to qgrid who stumbles across this!

from qgrid.

coltmac avatar coltmac commented on July 18, 2024

I'm am experiencing the same problem as the OP: web app works in jupyter notebooks (local), it works in Voila (local), but when I run it with Heroku - it doesn't display the jupyter notebook displays.

Heroku Warning:

2019-07-01T01:29:41.993853+00:00 heroku[router]: at=info method=GET path="/voila/bqplot.js" host=damp-retreat-67638.herokuapp.com request_id=e2e9446d-372c-41bb-b22f-90c4ae0e27b3 fwd="[hidden IP]" dyno=web.1 connect=0ms service=3ms status=404 bytes=240 protocol=https
2019-07-01T01:29:41.996535+00:00 app[web.1]: WARNING:tornado.access:404 GET /voila/bqplot.js (10.67.241.187) 1.09ms
2019-07-01T01:29:42.002571+00:00 app[web.1]: WARNING:tornado.access:404 GET /voila/qgrid.js (10.63.252.246) 0.90ms
2019-07-01T01:29:42.001537+00:00 heroku[router]: at=info method=GET path="/voila/qgrid.js" host=damp-retreat-67638.herokuapp.com request_id=6d6fdbe9-706d-4fdc-bb82-88c3462870c3 fwd="[hidden IP]" dyno=web.1 connect=1ms service=2ms status=404 bytes=240 protocol=https

it seems to be having trouble with "GET /voila/qgrid.js" and "GET /voila/bqplot.js"

Could this be a related issue?

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.