Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve the error, "module umap has no attribute UMAP".. I tried installing & reinstalling umap but didn't work to me

AttributeError: module 'umap' has no attribute 'UMAP'

I tried installing & reinstalling different libraries of umap and umap learn but didn't work any..

like image 374
user400882 Avatar asked Jul 28 '19 15:07

user400882


3 Answers

To use UMAP you need to install umap-learn not umap.
So, in case you installed umap run the following commands to uninstall umap and install upam-learn instead:

pip uninstall umap
pip install umap-learn

And then in your python code make sure you are importing the module using:

import umap.umap_ as umap

Instead of

import umap
like image 64
Rola Avatar answered Nov 07 '22 03:11

Rola


If you still facing the issue try this.

import umap.umap_ as umap
like image 12
Rahul Verma Avatar answered Nov 07 '22 03:11

Rahul Verma


I have got the same issue and found two solutions:

1 - Solving on your machine by updating the library via git

git clone https://github.com/lmcinnes/umap
cd umap
pip install --user -r requirements.txt
python setup.py install --user

Source

2 - Solving on Colab by forcing the installation of a version of umap

!pip install 'umap-learn==0.3.10'
like image 7
aberna Avatar answered Nov 07 '22 04:11

aberna