quantopian / qgrid

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

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

Open webzest opened 3 years ago

webzest commented 3 years ago

Environment

Description of Issue

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


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? ...
ericbdaniels commented 3 years ago

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

Regarding the pandas issue: https://github.com/quantopian/qgrid/issues/287