NTMC-Community / MatchZoo

Facilitating the design, comparison and sharing of deep text matching models.
Apache License 2.0
3.82k stars 898 forks source link

Does not work with the latest pandas #786

Closed matthew-z closed 4 years ago

matthew-z commented 4 years ago

Describe the bug

cannot import matchzoo with the latest pandas (in my case 0.25.1) due to the recent api changes in pandas.

Error message:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
~/.anaconda3/lib/python3.6/site-packages/tqdm/_tqdm.py in pandas(tclass, *targs, **tkwargs)
    593             # pandas>=0.23.0
--> 594             from pandas.core.groupby.groupby import DataFrameGroupBy, \
    595                 SeriesGroupBy, GroupBy, PanelGroupBy

ImportError: cannot import name 'DataFrameGroupBy'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-5-0e79b8132aad> in <module>()
----> 1 import matchzoo

~/.anaconda3/lib/python3.6/site-packages/matchzoo/__init__.py in <module>()
     11 from .version import __version__
     12 
---> 13 from .data_pack import DataPack
     14 from .data_pack import pack
     15 from .data_pack import load_data_pack

~/.anaconda3/lib/python3.6/site-packages/matchzoo/data_pack/__init__.py in <module>()
----> 1 from .data_pack import DataPack, load_data_pack
      2 from .pack import pack

~/.anaconda3/lib/python3.6/site-packages/matchzoo/data_pack/data_pack.py in <module>()
     13 import matchzoo
     14 
---> 15 tqdm.pandas()
     16 
     17 

~/.anaconda3/lib/python3.6/site-packages/tqdm/_tqdm.py in pandas(tclass, *targs, **tkwargs)
    595                 SeriesGroupBy, GroupBy, PanelGroupBy
    596         except ImportError:
--> 597             from pandas.core.groupby import DataFrameGroupBy, \
    598                 SeriesGroupBy, GroupBy, PanelGroupBy
    599 

ImportError: cannot import name 'PanelGroupBy'

To Reproduce

pip install -U pandas import matchzoo

Describe your attempts

downgrading pandas to 0.24 can solve this problem

Context

bwanglzu commented 4 years ago

@matthew-z can you downgrade/upgrade your tqdm to tqdm==4.33.0?

matthew-z commented 4 years ago

Right, upgrading tqdm can solve this problem.

bwanglzu commented 4 years ago

@matthew-z this is a dependency issue caused by tqdm & pandas, I'll close the issue. Feel free to open new issue for new questions.