boudinfl / pke

Python Keyphrase Extraction module
GNU General Public License v3.0
1.56k stars 290 forks source link

AttributeError: module 'scipy.sparse' has no attribute 'coo_array' #206

Closed rxnandakumar closed 2 years ago

rxnandakumar commented 2 years ago

Installed using !pip install git+https://github.com/boudinfl/pke.git

Made sure spacy is installed and the 'en' model is downloaded.

Similar error is posted for pyg - https://github.com/pyg-team/pytorch_geometric/issues/4378

Tried upgrading scipy and networkx as suggested there

pip install --upgrade scipy networkx Requirement already satisfied: scipy in /opt/anaconda3/lib/python3.9/site-packages (1.9.1) Requirement already satisfied: networkx in /opt/anaconda3/lib/python3.9/site-packages (2.8.6) Requirement already satisfied: numpy<1.25.0,>=1.18.5 in /opt/anaconda3/lib/python3.9/site-packages (from scipy) (1.21.5) But still getting the same error.

Worked fine on Google Colab, but I am trying with Anaconda Jypyter notebook now and came across this issue.

I checked the versions of scipy and networkx on Colab and they were 1.7.3 and 2.6.3 respectively and python was 3.7.14

I tried downgrading scipy and networkx to these versions, but it still didn't fix the issue. Apparently python 3.7.14 is not available from anaconda. Is there a dependency on a specific version of python?

ygorg commented 2 years ago

This issue is not related to pke, so nothing can be done on our end. But according to pyg-team/pytorch_geometric#4378 it seems like a "version conflict between networkx and scipy" and downgrading scipy before 1.8.0 might do the trick because coo_array does not appear before then.