Skip to content
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

(feature) Refer to a function defined in another module #5

Open
ygravrand opened this issue Apr 15, 2015 · 0 comments
Open

(feature) Refer to a function defined in another module #5

ygravrand opened this issue Apr 15, 2015 · 0 comments

Comments

@ygravrand
Copy link

When testing Multyvac during Pycon workshops, we ran into a problem when a function is defined in another module:

From the main example in cloudpipe, move 'add' function into a 'test' module and then:

from test import add
print 'Locally:', add(2,3)

job_id = multyvac.submit(add, 2, 3)
job = multyvac.get(job_id)
print 'Remotely:', job.get_result()

Results:

Locally: 2 + 3 = 5
5
Remotely:
Traceback (most recent call last):
  File "simpletest2.py", line 13, in <module>
    print 'Remotely:', job.get_result()
  File "$$edited$$/multyvac-fork/multyvac/job.py", line 105, in get_result
    raise e
multyvac.job.JobError: Traceback (most recent call last):
  File "/home/rho/anaconda/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/rho/anaconda/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/rho/anaconda/lib/python2.7/site-packages/multyvacinit/pybootstrap.py", line 10, in <module>
    (f, args, kwargs) = pickle.load(sys.stdin)
  File "/home/rho/anaconda/lib/python2.7/pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "/home/rho/anaconda/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/home/rho/anaconda/lib/python2.7/pickle.py", line 1090, in load_global
    klass = self.find_class(module, name)
  File "/home/rho/anaconda/lib/python2.7/pickle.py", line 1124, in find_class
    __import__(module)
ImportError: No module named test

Need to investigate in cloudpickle.

@ygravrand ygravrand changed the title Error referring to a function defined in another module (feature) Refer to a function defined in another module Apr 15, 2015
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

1 participant