<br><br><div class="gmail_quote">On Fri, Sep 7, 2012 at 1:48 PM, Michael Bilow <span dir="ltr"><<a href="mailto:michael.k.bilow@gmail.com" target="_blank">michael.k.bilow@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi!<div><br></div><div>I'm new to this list and to IPython, and I started using IPython to parallelize some code I'd written (complete code: <a href="https://github.com/chuyelchulo/ipython-nameerror" target="_blank">https://github.com/chuyelchulo/ipython-nameerror</a>, requires numpy and PIL). I've been encountering a confusing NameError that keeps popping up when I try to run this program: The function to be mapped (parallel_run) is imported from a module different from __main__, but the interpreter complains that the functions and modules used by parallel_run are not part of the namespace.</div>



<div><br></div><div>I asked about the error here (<a href="http://stackoverflow.com/questions/12304847/ipython-parallel-computing-namespace-issues" target="_blank">http://stackoverflow.com/questions/12304847/ipython-parallel-computing-namespace-issues</a>), and was told to come to this list.</div>

</blockquote><div><br></div><div>Hi again!</div><div><br></div><div>When I do the following:</div><div><br></div><div>$> cd /path/to/ipython-nameerror</div><div>$> ipcluster start -n 4 --daemon</div><div>$> python wrapper_wrapper.py</div>

<div>Time elapsed:  5.85908985138 s</div><div><br></div><div>It seems to work as expected.</div><div><br></div><div>A few quick questions:</div><div><br></div><div>1. what is the cwd when you run ipcluster?  Are your engines local or remote?  What do you get from:</div>

<div><br></div><div><div>import os</div><div>import pprint</div><div>from IPython import parallel</div><div><br></div><div>client = parallel.Client()</div><div>pprint.pprint(client[:].apply_async(os.getcwdu).get_dict())</div>

</div><div><br></div><div>or:</div><div><br></div><div>%px import wrapper</div><div><br></div><div>If I start the engines somewhere else such that `wrapper` is not importable, I get the NameErrors you are seeing.</div><div>

<br></div><div>-MinRK</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br></div><div>Thanks!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Michael</div><div>
</div>
</font></span><br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br>