<div dir="ltr"><div class="gmail_quote"><div dir="ltr">I have looked through the documentation about importing modules on IPython Parallel worker processes, and it seems imports of the form "import foo as bar" are not supported.  However, I found that using DirectView.execute allows me to get around this.  Is this safe, if not what can go wrong?<div>

<br></div><div>Here's the code I'm using to import part of the dateutil library and :<div><br></div><div>    from IPython.parallel import Client<br></div><div>    ipython_client = Client()</div><div>    dview = ipython_client.direct_view()</div>

<div>    dview.execute('from dateutil import parser as dtparser')</div><div><br></div><div>I am only using on my local PC, not a cluster.  After executing the above I can happily run code that uses dtparser using dview.map_sync.  I can rewrite my code to avoid doing this but I'd like to know why I shouldn't use this method.</div>

</div><div><br></div><div>Thanks in advance.</div></div>
</div><br><div>P.S. I posted this to IPython-User but that mailing list seems not to be active.  I anyone is receiving this for a second time, I apologize.</div></div>