When I write
%px import trackpy as tp
and then I use map_async with a function using the tp
module, it just works as expected.
If I wrote intead:
with client[:].sync_imports():
import trackpy as tp
I got a error "NameError: name 'tp' is not defined"
.
More exactly, with the following:
amr = view.map_async(function_using_tp, anArray)
amr.wait_interactive()
the "wait_interactive" is showing a "ipython wait line" as expected, but when I tried to access the first element of the result (amr[0]) I get the error ('tp' is not defined)
I guess it is linked to the fact my IPython is working on a new Python installation, and my system PYTHONPATH still points to an older Python installation.
I have three basic questions:
- how can I "debug" the import? (I don't get any feedback if the import worked on each engine or not.)
- how can I change the PYTHONPATH for engines? (I read about a ipengine_config.py but I have none on my computer)
- How can I accomplish the same thing as the
%px
IPython magic, since I'd like to be able to execute this outside of IPython? (e.g., as a DOS command: "ipython myScript.ipy")