[IPython-dev] ipython1 remote import faillure

Laurent Dufréchou laurent.dufrechou@free...
Fri Mar 23 15:46:05 CDT 2007


Hello there,
4 : rc.executeAll('import os,sys')
#5 : import os,sys
#6 : sys.path.append(os.path.abspath(os.path.curdir))

I've just dicovered your excellent ipython extension that is the chainsaw 
branch.
I'm currently evaluating it for a project of efficient remote script execution 
on multiple server.(and it seems to be quite good at this!)
During my evaluation, I've found a bug and it's a workaround.
I've seen that somebody had seen it previously with the pushModule method.
In my case, I try to execute an 'import' of a local library/script that is 
present in the working directory of the remote python server.
Let's have an example:

1 : import ipython1.kernel.api as kernel
2 : rc = kernel.RemoteController(('127.0.0.1',10105))
3 : rc.executeAll('import a')
>> fails because a.py can't be found BUT a.py is present in the working 
directory

>> workaround :
4 : rc.executeAll('import os,sys')
5 : rc.executeAll('sys.path.append(os.path.abspath(os.path.curdir))')
6 : rc.executeAll('import a')
>> now works!

Can't it be possible when ipengine starts, that it does exceute the 2 
workaround commands?

I've seen that there is a '-r' option (that i haven't tried yet) but I think 
this behaviour is more a bug than a missing feature, so i prefer to tell it 
on the mailing list.

Regards,

Laurent


More information about the IPython-dev mailing list