Umap: AttributeError: module 'umap' has no attribute 'plot'

Created on 4 Dec 2019  Â·  12Comments  Â·  Source: lmcinnes/umap

I am having a hard time installing umap.plot. My goal is to make the interactive plot here.

I am using iOS Mojave 10.14.5, umap-learn 0.3.10, Python 3.7.4.

Thanks!

Most helpful comment

Hi all,

I have installed from the latest git release, but get the below error. Would be grateful for clarification.

import umap.plot

ImportError Traceback (most recent call last)
in
1 import umap.nndescent
----> 2 import umap.plot

/usr/local/lib/python3.6/dist-packages/umap/plot.py in
22 from matplotlib.patches import Patch
23
---> 24 from umap.nndescent import initialise_search, initialized_nnd_search
25 from umap.utils import deheap_sort, submatrix
26

ImportError: cannot import name 'initialized_nnd_search'

All 12 comments

You require the 0.4-dev version located here: https://github.com/lmcinnes/umap/tree/0.4dev

Simply clone and install or install with pip from the repo: https://stackoverflow.com/questions/20101834/pip-install-from-git-repo-branch

Thank you!!

Hello, I tried the way you suggested but received the following error fatal: repository 'https://github.com/lmcinnes/umap/tree/0.4dev/' not found Do you have any idea about what might happen? Thanks!

No -- that seems very odd. On good news that branch has been merged into master, so you can just clone the repository and install that if you wish.

Oh thank you it works now!

Hi all,

I have installed from the latest git release, but get the below error. Would be grateful for clarification.

import umap.plot

ImportError Traceback (most recent call last)
in
1 import umap.nndescent
----> 2 import umap.plot

/usr/local/lib/python3.6/dist-packages/umap/plot.py in
22 from matplotlib.patches import Patch
23
---> 24 from umap.nndescent import initialise_search, initialized_nnd_search
25 from umap.utils import deheap_sort, submatrix
26

ImportError: cannot import name 'initialized_nnd_search'

Hi I was able to successfully build umap-learn from the master branch. However, I am getting this error when importing umap.plot.


AttributeError Traceback (most recent call last)
in
17
18 import umap
---> 19 import umap.plot
20
21 # silence NumbaPerformanceWarning

~\Anaconda3\lib\site-packages\umap\plot.py in
11 import matplotlib.cm
12
---> 13 import bokeh.plotting as bpl
14 import bokeh.transform as btr
15 import holoviews as hv

~\Anaconda3\lib\site-packages\bokeh\plotting__init__.py in
75 from ..models.layouts import Row, Column; Row, Column
76
---> 77 from ..io import curdoc; curdoc
78 from ..io import output_file; output_file
79 from ..io import output_notebook; output_notebook

~\Anaconda3\lib\site-packages\bokeh\io__init__.py in
49 from .doc import curdoc
50
---> 51 from .export import export_png
52 from .export import export_svgs
53

~\Anaconda3\lib\site-packages\bokeh\io\export.py in
32
33 # Bokeh imports
---> 34 from ..embed import file_html
35 from ..resources import INLINE
36 from ..util.dependencies import import_required

~\Anaconda3\lib\site-packages\bokeh\embed__init__.py in
52 #-----------------------------------------------------------------------------
53
---> 54 from .server import server_document
55 from .server import server_session
56

~\Anaconda3\lib\site-packages\bokeh\embed\server.py in
28 # Bokeh imports
29 from ..core.templates import AUTOLOAD_TAG, FILE
---> 30 from ..resources import DEFAULT_SERVER_HTTP_URL
31 from ..util.serialization import make_id
32 from ..util.string import encode_utf8, format_docstring

~\Anaconda3\lib\site-packages\bokeh\resources.py in
512 #-----------------------------------------------------------------------------
513
--> 514 CDN = Resources(mode="cdn")
515
516 INLINE = Resources(mode="inline")

~\Anaconda3\lib\site-packages\bokeh\resources.py in __init__(failed resolving arguments)
81 self.mode = settings.resources(mode); del mode
82 self.root_dir = settings.rootdir(root_dir); del root_dir
---> 83 self.version = settings.version(version); del version
84 self.minified = settings.minified(minified); del minified
85 self.log_level = settings.log_level(log_level); del log_level

AttributeError: 'Settings' object has no attribute 'version'

It seems like bokeh is failing to load; I am not sure why. See in you can do

import bokeh.plotting as bpl

alone, and if not then that is defnitely the problem and you may have to check with the bokeh people.

Hi Leland McInnes! Nice to hear from you. I was able to solve the problem
by using a specific version of umap Thank you and cheers!

On Fri, Mar 20, 2020 at 9:19 PM Leland McInnes notifications@github.com
wrote:

It seems like bokeh is failing to load; I am not sure why. See in you can
do

import bokeh.plotting as bpl

alone, and if not then that is defnitely the problem and you may have to
check with the bokeh people.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/lmcinnes/umap/issues/321#issuecomment-601696319, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ADU4TLWB42CU742NRIJ7UU3RINUN5ANCNFSM4JVEJEDA
.

I spent an hour on this issue. That is what finally helped me:

  1. uninstall all umaps you have (umap, umap-learn)
  2. update all conda packages conda update --all
  3. install umap 0.4-dev version located here: https://github.com/lmcinnes/umap/tree/0.4dev
  4. use the following import:
import umap.umap_ as umap
import umap.plot

Sorry for your difficulties @galinaalperovich ; but thanks for providing a workaround that worked for you, and hopefully others. The full release of 0.4 is getting awfully close, so hopefully this will not be an issue in the near future. Thanks again for your patience.

Sorry for your difficulties @galinaalperovich ; but thanks for providing a workaround that worked for you, and hopefully others. The full release of 0.4 is getting awfully close, so hopefully this will not be an issue in the near future. Thanks again for your patience.

No problem, thank you for preparing a great upcoming release :) I already was able to build a very pretty graph with the new umap.plot package. Looking forward to 0.4 release!

Was this page helpful?
0 / 5 - 0 ratings