Skip to content

multiprocessing and offline mode results in pickle error. #786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dsmale opened this issue Jun 28, 2017 · 1 comment
Closed

multiprocessing and offline mode results in pickle error. #786

dsmale opened this issue Jun 28, 2017 · 1 comment
Assignees
Milestone

Comments

@dsmale
Copy link

dsmale commented Jun 28, 2017

Simply setting plotly.offline.init_notebook_mode(connected=True) results in a cPickle.PicklingError.

Traceback (most recent call last):
  File "meh.py", line 13, in 
    results = pool.map(do_something, ["foo", "bar"])
  File "/usr/local/lib/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/local/lib/python2.7/multiprocessing/pool.py", line 567, in get
    raise self._value
cPickle.PicklingError: Can't pickle : attribute lookup __builtin__.function failed

Example code:

import multiprocessing as mp
import plotly

plotly.offline.init_notebook_mode(connected=True)

def do_something(s):
  return s

if __name__ == "__main__":
   pool_size = mp.cpu_count()
   pool = mp.Pool(processes=pool_size)
   results = pool.map(do_something, ["foo", "bar"])
   pool.close()
   pool.join()
   print results

@dsmale dsmale changed the title multiprocessying and offline mode results in pickle error. multiprocessing and offline mode results in pickle error. Jun 28, 2017
@jonmmease jonmmease self-assigned this Sep 21, 2018
@jonmmease jonmmease modified the milestones: v3.4.0, v3.3.0 Sep 21, 2018
@jonmmease
Copy link
Contributor

Closed by #1191 with the implementation of pickle support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants