title: Trying to generate bokeh plots using python multiprocessing, ended up getting below error
body: <p>I am trying to generate and return bokeh plots. In this process I am using python multiprocessing to speed up the process as I have more number of plots to generate.</p>
  
  <p>Below is an example of how my code looks like ..</p>
  
  <pre><code> from multiprocessing import Pool
   from bokeh.plotting import gridplot
  
   class A():
      def __init__(self, x, y, z):
          self.x = x
          self.y = y
          self.z = z
  
      def generate_bokeh_plot(self, id):
          # This method will generate and return bokeh plot
          # Also, I am using above x, y, z in this method 
  
          # This is an example of how my plot looks like and I am returning this
          plot = &lt;class 'bokeh.plotting.figure.Figure'&gt;
  
          return plot
  
  obj = A(x,y,z)
  # Mine is 8 core machine, I am using 7 at a time
  pool = pool(7)
  plots = pool.map(obj.generate_bokeh_plot, id_list)
  pool.close()
  pool.join()
  
  panel = gridplot(plots)
  script, div = components(panel)
  </code></pre>
  
  <p>For this I am getting the following error</p>
  
  <pre><code>multiprocess.pool.MaybeEncodingError: Error sending result: '[Column(id='b80aa557-5157-4d5d-b891-236642b96abe', ...)]'. Reason: 'PicklingError("Can't pickle &lt;class 'bokeh.core.enums.Enumeration'&gt;: it's not the same object as bokeh.core.enums.Enumeration",)'
  </code></pre>
  
  <p>I also tried using pathos, ended up getting same error </p>
  
  <pre><code>import pathos.pools as pp
  p = pp.ProcessPool(7)
  p.map()
  
  or 
  
  from pathos.multiprocessing import ProcessingPool as Pool
  pool = Pool(7)
  pool.map()
  </code></pre>
  
  <p><strong>My Environment:</strong> I am using Python 3.6 with Pyramid web framework, RHEL</p>
  
  <p>Any help on this issue will be greatly appreciated :)</p>