I played with IPython.parallel and I wanted to use some of my own native modules, but could not do this, as explained on the cookbook , using dview.sync_imports() . The only thing that worked for me was something like
def my_parallel_func(args): import sys sys.path.append('/path/to/my/module') import my_module #and all the rest
and then basically just
if __name__=='__main__': #set up dview... dview.map( my_parallel_func, my_args )
The right way to do this, in my opinion, would be something like
with dview.sync_imports(): import sys sys.path.append('/path/to/my/module') import my_module
but this causes an error saying that there is no module named my_module .
So what is the correct way to do this using dview.sync_imports() ??
python ipython ipython-parallel
Alex s
source share