Search code examples
jupyter-notebookanacondajupytercondaattributeerror

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


Getting this error in my Jupyter Notebook What would be the best way to fix this utilizing conda instead of pip

I've attempted conda upgrade --all and that didnt seem to work


Solution

  • The scipy.sparse.*_array functions were introduced with v1.8. The networkx package started requiring scipy >=1.8 with v2.7. So, either upgrade SciPy

    conda install 'scipy>=1.8'
    

    or downgrade NetworkX:

    conda install 'networkx<2.7'
    

    Part of the issue here is that, at the recommendation of a networkx developer, Conda Forge stopped explicitly requiring scipy as a dependency of networkx, and therefore there is no longer any constraint. I opened an issue on the feedstock to revisit coinstallation constraints (run_constrained specifications).