quantopian / qgrid

An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks
Apache License 2.0
3.04k stars 422 forks source link

qgrid does not appear #163

Closed sergun closed 6 years ago

sergun commented 6 years ago

Environment

_nb_ext_conf 0.3.0 py27_0 anaconda-client 1.6.3 py27_0 backports 1.0 py27_0 backports_abc 0.5 py27_0 bleach 1.5.0 py27_0 ca-certificates 2017.11.5 0 conda-forge clyent 1.2.2 py27_0 colorama 0.3.9 py27_0 configparser 3.5.0 py27_0 cycler 0.10.0 py27_0 decorator 4.0.11 py27_0 entrypoints 0.2.2 py27_1 enum34 1.1.6 py27_0 functools32 3.2.3.2 py27_0 get_terminal_size 1.0.0 py27_0 html5lib 0.999 py27_0 icu 57.1 vc9_0 [vc9] ipykernel 4.6.1 py27_0 ipython 5.3.0 py27_0 ipython_genutils 0.2.0 py27_0 ipywidgets 7.0.5 py27hac8cb9a_0 jinja2 2.9.6 py27_0 jpeg 9b vc9_0 [vc9] jsonschema 2.6.0 py27_0 jupyter 1.0.0 py27_3 jupyter_client 5.0.1 py27_0 jupyter_console 5.1.0 py27_0 jupyter_contrib_core 0.3.1 py27_0 conda-forge jupyter_contrib_nbextensions 0.2.8 py27_1 conda-forge jupyter_core 4.3.0 py27_0 jupyter_highlight_selected_word 0.0.10 py27_0 conda-forge jupyter_latex_envs 1.3.8.2 py27_1 conda-forge jupyter_nbextensions_configurator 0.2.5 py27_0 conda-forge libgpuarray 0.7.5 vc9_0 [vc9] conda-forge libpng 1.6.27 vc9_0 [vc9] libpython 2.0 py27_0 m2w64-binutils 2.25.1 5 m2w64-bzip2 1.0.6 6 m2w64-crt-git 5.0.0.4636.2595836 2 m2w64-gcc 5.3.0 6 m2w64-gcc-ada 5.3.0 6 m2w64-gcc-fortran 5.3.0 6 m2w64-gcc-libgfortran 5.3.0 6 m2w64-gcc-libs 5.3.0 7 m2w64-gcc-libs-core 5.3.0 7 m2w64-gcc-objc 5.3.0 6 m2w64-gmp 6.1.0 2 m2w64-headers-git 5.0.0.4636.c0ad18a 2 m2w64-isl 0.16.1 2 m2w64-libiconv 1.14 6 m2w64-libmangle-git 5.0.0.4509.2e5a9a2 2 m2w64-libwinpthread-git 5.0.0.4634.697f757 2 m2w64-make 4.1.2351.a80a8b8 2 m2w64-mpc 1.0.3 3 m2w64-mpfr 3.1.4 4 m2w64-pkg-config 0.29.1 2 m2w64-toolchain 5.3.0 7 m2w64-tools-git 5.0.0.4592.90b8472 2 m2w64-windows-default-manifest 6.4 3 m2w64-winpthreads-git 5.0.0.4634.697f757 2 m2w64-zlib 1.2.8 10 mako 1.0.7 py27_0 conda-forge markupsafe 0.23 py27_2 matplotlib 2.0.2 np113py27_0 mistune 0.7.4 py27_0 mkl 2017.0.1 0 mkl-service 1.1.2 py27_3 msys2-conda-epoch 20160418 1 nb_anacondacloud 1.2.0 py27_0 nb_conda 2.0.0 py27_0 nb_conda_kernels 2.0.0 py27_0 nbconvert 5.2.1 py27_0 nbformat 4.3.0 py27_0 nbpresent 3.0.2 py27_0 nose 1.3.7 py27h84c72c6_2 notebook 5.0.0 py27_0 numexpr 2.6.2 np113py27_0 numpy 1.13.0 py27_0 openssl 1.0.2m vc9_0 [vc9] conda-forge pandas 0.20.2 np113py27_0 pandoc 1.19.2.1 1 pandocfilters 1.4.1 py27_0 path.py 10.3.1 py27_0 pathlib2 2.2.1 py27_0 pickleshare 0.7.4 py27_0 pip 9.0.1 py27_1 plotly 2.0.9 py27_0 prompt_toolkit 1.0.14 py27_0 psutil 5.2.1 py27_0 conda-forge pygments 2.2.0 py27_0 pygpu 0.7.5 py27_0 conda-forge pyparsing 2.1.4 py27_0 pyqt 5.6.0 py27_2 python 2.7.13 1 python-dateutil 2.6.0 py27_0 pytz 2017.2 py27_0 pyyaml 3.12 py27_0 pyzmq 16.0.2 py27_0 qgrid 1.0.0 qt 5.6.2 vc9_4 [vc9] qtconsole 4.3.0 py27_0 requests 2.14.2 py27_0 scandir 1.5 py27_0 scikit-learn 0.18.1 np113py27_1 scipy 0.19.0 np113py27_0 seaborn 0.7.1 py27_0 setuptools 27.2.0 py27_1 simplegeneric 0.8.1 py27_1 singledispatch 3.4.0.3 py27_0 sip 4.18 py27_0 six 1.10.0 py27_0 ssl_match_hostname 3.4.0.2 py27_1 subprocess32 3.2.7 py27_0 testpath 0.3.1 py27_0 theano 0.9.0 py27_0 tk 8.5.18 vc9_0 [vc9] tornado 4.5.1 py27_0 traitlets 4.3.2 py27_0 vc 9 0 conda-forge vs2008_runtime 9.00.30729.5054 0 wcwidth 0.1.7 py27_0 wheel 0.29.0 py27_0 widgetsnbextension 3.0.8 py27hc754cff_0 win_unicode_console 0.5 py27_0 xgboost 0.6 zlib 1.2.8 vc9_3 [vc9]

Description of Issue

Reproduction Steps

import numpy as np
import pandas as pd
import qgrid
randn = np.random.randn
df_types = pd.DataFrame({
    'A' : 1.,
    'B' : pd.Series(['2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04',
               '2013-01-05', '2013-01-06', '2013-01-07', '2013-01-08', '2013-01-09'],index=list(range(9)),dtype='datetime64[ns]'),
    'C' : pd.Series(randn(9),index=list(range(9)),dtype='float32'),
    'D' : np.array([3] * 9,dtype='int32'),
    'E' : pd.Categorical(["washington", "adams", "washington", "madison", "lincoln","jefferson", "hamilton", "roosevelt", "kennedy"]),
    'F' : ["foo", "bar", "buzz", "bippity","boppity", "foo", "foo", "bar", "zoo"] })
df_types['G'] = df_types['F'] == 'foo'
qgrid_widget = qgrid.QgridWidget(df=df_types, show_toolbar=True)
qgrid_widget
TimShawver commented 6 years ago

Sorry I'm a bit confused because it looks like you're saying you installed with pip install qgrid but the packages you're listing look like conda packages. Did you mean to say that you installed with conda install -c tim_shawver qgrid?

Also do you see any errors in the logs for the notebook server? How about in the notebook below the cell that you executed, or in the js console of your browser?

sergun commented 6 years ago

I used pip in conda environment because didn't find fresh qgrid version in default channel of anaconda.

The same story on another computer it is on Linux and I use jupyterhub. I'm I right I should install qgrid to environment used in Jupyter notebook not in jupyterhub environment?

What I see on Linux now (CHrome Dveveloper mode): image

sergun commented 6 years ago

After shift+F5 I found that such URL gives HTTP 404: https://myserver/user/me/static/qgrid.js?v=20180116153104

What can be a reason? Other ipywidgets works fine

TimShawver commented 6 years ago

I see those same errors if I have the qgrid package installed via pip but I have not yet run jupyter nbextension enable --py --sys-prefix qgrid to enable the widget.

I'm not sure about your jupyterhub setup but with the default setup, I've found that installing qgrid in the same virtualenv as jupyterhub and enabling it there seems to work. For more complex jupyterhub setups where the notebooks server is launched in some sort of isolated environment like a docker container, I think you'd need to add that jupyter nbextension enable command to the code which launches your notebook servers.

FYI the conda package will be available on a default channel soon hopefully. I have a PR open to add it to conda-forge but it's not quite merged yet: https://github.com/conda-forge/staged-recipes/pull/4752

sergun commented 6 years ago

@TimShawver your advise helped. I recreated conda environment. Installed qgrid from your conda channel: conda install -c tim_shawver qgrid and executed: jupyter nbextension enable --py --sys-prefix qgrid

You are right, the last step is mandatory on Windows

Thank you!