quantopian/qgrid

Trouble getting qgrid to work with Jupyter Notebooks on Windows 10.

webzest opened this issue · 1 comments

Environment

  • Operating System: Windows 10

  • Python Version: 3.6.13

  • How did you install Qgrid: python -m pip install qgrip --force --upgrade

  • Python packages:
    absl-py==0.11.0
    anyio==2.1.0
    argon2-cffi==20.1.0
    astunparse==1.6.3
    async-generator==1.10
    attrs==20.3.0
    Babel==2.9.0
    backcall==0.2.0
    bleach==3.3.0
    cachetools==4.2.1
    catboost==0.24.4
    certifi==2020.12.5
    cffi==1.14.5
    chardet==4.0.0
    colorama==0.4.4
    common-cmplr-lib-rt==2021.1.2
    common-cmplr-lic-rt==2021.1.2
    contextvars==2.4
    cycler==0.10.0
    daal==2021.1.2
    daal4py==2021.1
    dataclasses==0.8
    decorator==4.4.2
    defusedxml==0.6.0
    dpcpp-cpp-rt==2021.1.2
    entrypoints==0.3
    flatbuffers==1.12
    gast==0.3.3
    google-auth==1.27.0
    google-auth-oauthlib==0.4.2
    google-pasta==0.2.0
    graphviz==0.16
    grpcio==1.32.0
    h5py==2.10.0
    idna==2.10
    imageio==2.9.0
    immutables==0.15
    importlib-metadata==3.4.0
    intel-openmp==2021.1.2
    ipykernel==5.4.3
    ipython==7.16.1
    ipython-genutils==0.2.0
    ipywidgets==7.6.3
    jedi==0.18.0
    Jinja2==2.11.3
    joblib==1.0.1
    json5==0.9.5
    jsonschema==3.2.0
    jupyter==1.0.0
    jupyter-client==6.1.11
    jupyter-console==6.2.0
    jupyter-core==4.7.1
    jupyter-server==1.4.0
    jupyterlab==3.0.8
    jupyterlab-pygments==0.1.2
    jupyterlab-server==2.3.0
    jupyterlab-widgets==1.0.0
    kaggle==1.5.10
    Keras==2.4.3
    Keras-Preprocessing==1.1.2
    kiwisolver==1.3.1
    lightgbm==3.1.1
    llvmlite==0.35.0
    Markdown==3.3.3
    MarkupSafe==1.1.1
    matplotlib==3.3.4
    mistune==0.8.4
    nbclassic==0.2.6
    nbclient==0.5.2
    nbconvert==6.0.7
    nbformat==5.1.2
    nest-asyncio==1.5.1
    networkx==2.5
    notebook==6.2.0
    numba==0.52.0
    numpy==1.19.5
    oauthlib==3.1.0
    opencl-rt==2021.1.2
    opt-einsum==3.3.0
    Optunity==1.1.1
    packaging==20.9
    pandas==1.1.5
    pandocfilters==1.4.3
    parso==0.8.1
    pickleshare==0.7.5
    Pillow==8.1.0
    plotly==4.14.3
    prometheus-client==0.9.0
    prompt-toolkit==3.0.16
    protobuf==3.15.0
    pyasn1==0.4.8
    pyasn1-modules==0.2.8
    pycparser==2.20
    pydot==1.4.2
    Pygments==2.8.0
    pyparsing==2.4.7
    pyrsistent==0.17.3
    python-dateutil==2.8.1
    python-slugify==4.0.1
    pytz==2021.1
    PyWavelets==1.1.1
    pywin32==300
    pywinpty==0.5.7
    PyYAML==5.4.1
    pyzmq==22.0.3
    qgrid==1.3.1
    qtconsole==5.0.2
    QtPy==1.9.0
    requests==2.25.1
    requests-oauthlib==1.3.0
    retrying==1.3.3
    rsa==4.7.1
    scikit-image==0.17.2
    scikit-learn==0.24.1
    scipy==1.5.4
    seaborn==0.11.1
    Send2Trash==1.5.0
    six==1.15.0
    sniffio==1.2.0
    tbb==2021.1.1
    tbb4py==2021.1.1
    tensorboard==2.4.1
    tensorboard-plugin-wit==1.8.0
    tensorflow==2.4.1
    tensorflow-estimator==2.4.0
    termcolor==1.1.0
    terminado==0.9.2
    testpath==0.4.4
    text-unidecode==1.3
    threadpoolctl==2.1.0
    tifffile==2020.9.3
    tornado==6.1
    tqdm==4.57.0
    traitlets==4.3.3
    typing-extensions==3.7.4.3
    urllib3==1.26.3
    vecstack==0.4.0
    wcwidth==0.2.5
    webencodings==0.5.1
    Werkzeug==1.0.1
    widgetsnbextension==3.5.1
    wincertstore==0.2
    world-bank-data==0.1.3
    wrapt==1.12.1
    zipp==3.4.0

  • Jupyter lab packages (if applicable): JupyterLab v3.0.8

Description of Issue

  • What did you expect to happen?

import qgrid
import pandas as pd
df = pd.read_csv('data/titanic.csv')
qgrid.show_grid(df)

// Received the following error:
Unable to load a compatible version of the widget 'qgrid'. Consider downgrading to version 1.1.1. Error: Module qgrid, semver range ^1.1.3 is not registered as a widget module

  • What happened instead?
    // Then, I downgraded to version 1.1.1 as suggested, and received the following error:

AttributeError Traceback (most recent call last)
in
2 import pandas as pd
3 df = pd.read_csv('data/titanic.csv')
----> 4 qgrid.show_grid(df)

C:\ProgramData\Miniconda3\envs\tsf\lib\site-packages\qgrid\grid.py in show_grid(data_frame, show_toolbar, precision, grid_options, column_options, column_definitions, row_edit_callback)
509 column_definitions=column_definitions,
510 row_edit_callback=row_edit_callback,
--> 511 show_toolbar=show_toolbar)
512
513

C:\ProgramData\Miniconda3\envs\tsf\lib\site-packages\qgrid\grid.py in init(self, *args, **kwargs)
625
626 if self.df is not None:
--> 627 self._update_df()
628
629 def _grid_options_default(self):

C:\ProgramData\Miniconda3\envs\tsf\lib\site-packages\qgrid\grid.py in _update_df(self)
818 self._unfiltered_df = self._df.copy()
819
--> 820 self._update_table(update_columns=True, fire_data_change_event=False)
821 self._ignore_df_changed = False
822

C:\ProgramData\Miniconda3\envs\tsf\lib\site-packages\qgrid\grid.py in _update_table(self, update_columns, triggered_by, scroll_to_row, fire_data_change_event)
877 isinstance(col_series, pd.PeriodIndex)
878
--> 879 if type(df.index) == pd.core.index.MultiIndex:
880 self._multi_index = True
881 for idx, cur_level in enumerate(df.index.levels):

AttributeError: module 'pandas.core' has no attribute 'index'

Reproduction Steps

  1. Install the latest version of Miniconda that includes Python V3.8
  2. conda create -n tsf python=3.7.7 cudatoolkit -y
  3. conda activate tsf
  4. python -m pip install vecstack kaggle scikit-image catboost ipykernel numpy pandas scipy scikit-learn daal4py tbb4py seaborn matplotlib pydot lightgbm jupyter numba keras tensorflow qgrid world_bank_data

Then, I launched Visual Studio and created a brand new notebook file and added the import and for qgrid and data.
...

What steps have you taken to resolve this already?

I tried to downgrade and tried other versions of Python.
...

Anything else?

How do I get qgrid to work with jupyter notebooks on windows 10?
Do you have a formula or a recipe that I can use to install a compatible environment to work with qgrid?
...

Qgrid doesn't currently work with jupyterlab 3+, I believe that is likely your original issue.

Regarding the pandas issue: #287