1

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")
tacaswell
  • 84,579
  • 22
  • 210
  • 199
2diabolos.com
  • 992
  • 9
  • 15
  • If you don't have an ipengine_config, file, you can create your own. The other two questions seem like they are orthogonal to eachother and should be in separate questions. – Paul H Dec 21 '15 at 16:51

0 Answers0