Easier way to avoid:RuntimeError: Models must be owned by only a single document, LinearAxis(id='7854', ...) is already in a doc

Hard to say anything specific without seeing the actual notebook. Some generic advice:

  • Don’t reuse variables
  • Don’t reuse Bokeh models between documents
  • Don’t create models at the top level of a cell. Instead, wrap them all in a function and call that function (similar to how bokeh serve does it internally)
2 Likes