module 'umap' has no attribute '__version__'
See original GitHub issueHey!
I hope you are doing well.
I run into the error AttributeError: module ‘umap’ has no attribute ‘version’ when running this code:
import pandas as pd
#pd.set_option("display.max_columns", None)
import numpy as np
import anndata
import scanpy as sc
%store -r df
adata = anndata.AnnData(df)
sc.pp.neighbors(adata, n_neighbors=10, n_pcs=40)
sc.tl.paga(adata)
sc.pl.paga(adata, plot=False)
sc.tl.umap(adata, init_pos='paga')
I am using Python 3.8 on Jupyter Notebooks on Mac M1.
Please find below the error in a more detailed fashion:
AttributeError Traceback (most recent call last)
<ipython-input-7-7cfb2fb3103e> in <module>
----> 1 sc.tl.umap(adata, init_pos='paga')
2 sc.pl.umap(adata)
~/opt/anaconda3/lib/python3.8/site-packages/scanpy/tools/_umap.py in umap(adata, min_dist, spread, n_components, maxiter, alpha, gamma, negative_sample_rate, init_pos, random_state, a, b, copy, method, neighbors_key)
141 import umap
142
--> 143 if version.parse(umap.__version__) >= version.parse("0.5.0"):
144
145 def simplicial_set_embedding(*args, **kwargs):
AttributeError: module 'umap' has no attribute '__version__'
Would you have any idea on how to solve this? I think it is a package dependency problem.
Thank you in advance for your help!
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
How to resolve the error, "module umap has no attribute ...
I changed the name to umap_application.py and the problem was resolved. So, check if you named any of your files as umap. Share....
Read more >module 'umap' has no attribute 'UMAP' · Issue #828 - GitHub
I have umap-learn installed, not umap. I have tried importing as above, no luck. Any ideas? my error is this: AttributeError: module 'umap'...
Read more >Attributeerror module umap has no attribute umap ( Solved )
Attributeerror module umap has no attribute umap error occurs because of using incorrect module umap in the place of umap-learn before importing umap....
Read more >RunUMAP in Seurat not working: module 'umap' has no ...
This is resolved by installing the more recent version of the code from GitHub. git clone https://github.com/lmcinnes/umap cd umap pip ...
Read more >umap-learn - PyPI
UMAP. Uniform Manifold Approximation and Projection (UMAP) is a dimension reduction technique that can be used for visualisation similarly to t-SNE, ...
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 Free
Top 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
Figure it out. In my case it’s because I have both
umap
andumap-learn
installed, see here: https://github.com/theislab/scanpy/issues/2045#issuecomment-963533994Why are we using
umap.__version__
instead ofimportlib.metadata.version('umap-learn')
?