AttributeError: module 'scipy.sparse' has no attribute 'csgraph'
See original GitHub issueHello,
Thank you for the great contribution.
I can’t seem to get it running. Any help is appreciated.
Here are my versions:
Requirement already satisfied: umap-learn in ./anaconda3/lib/python3.6/site-packages
Requirement already satisfied: numba>=0.34 in ./anaconda3/lib/python3.6/site-packages (from umap-learn)
Requirement already satisfied: scipy>=0.19 in ./anaconda3/lib/python3.6/site-packages (from umap-learn)
Requirement already satisfied: scikit-learn>=0.16 in ./anaconda3/lib/python3.6/site-packages (from umap-learn)
Requirement already satisfied: llvmlite in ./anaconda3/lib/python3.6/site-packages (from numba>=0.34->umap-learn)
Requirement already satisfied: numpy in ./anaconda3/lib/python3.6/site-packages (from numba>=0.34->umap-learn)
Running the example,
import umap
from sklearn.datasets import load_digits
digits = load_digits()
embedding = umap.UMAP().fit_transform(digits.data)
outputs:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-32-e5c7a5ee7150> in <module>()
4 digits = load_digits()
5
----> 6 embedding = umap.UMAP().fit_transform(digits.data)
~/anaconda3/lib/python3.6/site-packages/umap/umap_.py in fit_transform(self, X, y)
~/anaconda3/lib/python3.6/site-packages/umap/umap_.py in fit(self, X, y)
~/anaconda3/lib/python3.6/site-packages/umap/umap_.py in simplicial_set_embedding(graph, n_components, initial_alpha, a, b, gamma, negative_sample_rate, n_epochs, init, random_state, verbose)
~/anaconda3/lib/python3.6/site-packages/umap/umap_.py in spectral_layout(graph, dim, random_state)
AttributeError: module 'scipy.sparse' has no attribute 'csgraph'
But I can import csgraph witout problems from scipy,
from scipy.sparse import csgraph
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:26 (8 by maintainers)
Top Results From Across the Web
AttributeError: module 'scipy.sparse' has no attribute 'coo_array'
The scipy.sparse.*_array functions were introduced with v1.8. The networkx package started requiring scipy >=1.8 with v2.7.
Read more >Scipy sparse setuptools issues - Python Forum
You have post to what code/library you use. sparsetools was removed ... AttributeError: module 'scipy.sparse' has no attribute 'sparsetools'.
Read more >AttributeError:模块'scipy.sparse'没有属性'coo_array' (module ...
解决AttributeError: module 'scipy.sparse' has no attribute 'csgraph'问题添加语句即可: from scipy.sparse.csgraph import connected_components.
Read more >scipy.sparse.csr_matrix — SciPy v1.9.3 Manual
If the shape parameter is not supplied, the matrix dimensions are inferred from the index arrays. Notes. Sparse matrices can be used in...
Read more >module 'scipy.sparse' has no attribute 'coo_array'
Problem with draw_networkx: module 'scipy.sparse' has no attribute 'coo_array' ... AttributeError Traceback (most recent call last) Input In [31], ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Scipy 1.1.0 has release, so in ubuntu python 3.6.4 just
pip install -U scipy
scipy 1.1.0 installed, problem sloved!You can maybe exclude scipy==1.0 in setup.py.