quantopian / qgrid

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

"ImportError: cannot import name 'Mapping' from 'collections' (C:\ProgramData\anaconda3\lib\collections\__init__.py)" #386

Open lnxq opened 1 year ago

lnxq commented 1 year ago

Environment

Windows 11 Python 3.10.9 pip install qgrid Jupyter lab packages: bqplot v0.5.40 enabled ok (python, bqplot) jupyterlab-plotly v5.14.1 enabled ok jupyterlab_pygments v0.2.2 enabled ok (python, jupyterlab_pygments) @jupyter-widgets/jupyterlab-manager v5.0.7 enabled ok (python, jupyterlab_widgets) @voila-dashboards/jupyterlab-preview v2.2.0 enabled ok (python, voila)

Description of Issue

When attempting to implement python qgrid in a data analysis script, the following error was raised: "ImportError: cannot import name 'Mapping' from 'collections' (C:\ProgramData\anaconda3\lib\collections__init__.py)"

I have attempted to reinstall various related packages etc., and I have tried the several answers that relate to it when searched online, but nothing seems to work. For instance:

I added the following lines to the "C:\ProgramData\anaconda3\lib\collections__init__.py" file

from _collections_abc import Mapping from _collections_abc import MutableMapping from _collections_abc import Sequence

so I got by the 'Mapping' package error, only to get an error for the 'Iterable' package. Fix one error with the package, only for another related error to crop up.

Spent lots of time trying to solve this, to no avail. Sounds like a promising package, but I can't get it to work.