question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bokeh class definition for `_ModelInDocument` has either moved or been deprecated, import needs to be updated

See original GitHub issue

In Bokeh 12.5dev14 release, the class _ModelInDocument is no longer defined in bokeh.model. This is required for datashader.bokeh_ext.InteractiveImage. Here is the traceback:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-7-9d4688ff35b4> in <module>()
      1 import datashader
----> 2 from datashader.bokeh_ext import InteractiveImage

/Users/schowell/data/code/datashader/datashader/bokeh_ext.py in <module>()
      8 from bokeh.io import notebook_div
      9 from bokeh.models import CustomJS, ColumnDataSource, Square, HoverTool, GlyphRenderer
---> 10 from bokeh.model import _ModelInDocument as add_to_document
     11 from bokeh.io import _CommsHandle
     12 from bokeh.util.notebook import get_comms

ImportError: cannot import name '_ModelInDocument'

There is a function definition for _ModelInDocument in bokeh/embed.py but it is different code. I am not sure where this got moved to but it breaks the bokeh extension for interactive datashader images. @bokeh/core was this class definition moved or deprecated?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
StevenCHowellcommented, Apr 24, 2017

Bokeh has been updated to 0.12.5, while datashader remains at vanilla 0.4.0 and therefore none of the examples can be used.

@sbanjac you can install specific versions of packages, e.g., conda install bokeh=0.12.4. You should have a look at creating conda environments. I just created a conda environment with datashader, Bokeh 0.12.4, and Jupyter, which I could use to generate bokeh/datashader plots. You would create the environment using

$> conda create -y -n ds python=3.5 datashader bokeh=0.12.4 jupyter

then activate the environment using

$> source activate ds

This will allow you to now use datashader with bokeh.

0reactions
astrojuanlucommented, Sep 19, 2017

You are right, there is no conda-forge package and I was running datashader 0.4.0 from the main conda channels. Sorry for the noise and thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

bokeh.models.formatters — Bokeh 3.0.1 Documentation
This page is documentation for a DEVELOPMENT / PRE-RELEASE version. For the latest release, go to https://docs.bokeh.org/en/latest/ 3.0.1. latest3.0.22.4.32.3. ...
Read more >
BokehDeprecationWarnings with Bokeh v1.4.0 #51 - GitHub
The latest release of the Bokeh package has deprecated the legend keyword, so the output of all plots now includes the following message:....
Read more >
API Changes — Matplotlib 1.5.3 documentation
Therefore code involving it has been removed from all but the wx backend (where it partially works), and its use is deprecated. The...
Read more >
Releases — HoloViews v1.15.3
9 series, many new features on the master branch have been released. Features relating to datashader support, linked selection and improvements to the...
Read more >
Version 0.22.2.post1 — scikit-learn 1.2.0 documentation
birch import Birch (in practice, birch.py has been moved to _birch.py ). Note. All the tools in the public API should be documented...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found