[IPython-dev] Auto-discard notification

David Huard david.huard at gmail.com
Thu Jan 18 16:03:11 EST 2007


Ok, now I can push the module, but the import fails.

So for instance

>>> from tests import model_1
>>> rc.pushModule(model_1)
Locating the module...
Module (model_1) found in:
tests
[127.0.0.1:0] In [25]: os.system('tar -xf model_1.tar')
[127.0.0.1:0] Out[25]: 0
[127.0.0.1:1] In [34]: os.system('tar -xf model_1.tar')
[127.0.0.1:1] Out[34]: 0
[127.0.0.1:2] In [23]: os.system('tar -xf model_1.tar')
[127.0.0.1:2] Out[23]: 0
[127.0.0.1:3] In [18]: os.system('tar -xf model_1.tar')
[127.0.0.1:3] Out[18]: 0

>>> rc.executeAll('import model_1')
[127.0.0.1:1] In [35]: import model_1
[127.0.0.1:1] Err[35]:
 Traceback (most recent call last):
  File "<console>", line 1, in ?
ImportError: No module named model_1

The model_1.tar file is in the local directory, but the engines doesn't seem
to find the module on their side.
Where do the engines live ? rc.executeAll('os.getcwd()') return the local
dir, but the engines themselves must be elsewhere, since they can't find the
modules locally.

Cheers,

David

P.S. Fernando, don't bother sending the patch, svn checking is easier for
both of us.



2007/1/18, Fernando Perez <Fernando.Perez at colorado.edu>:
>
> David Huard wrote:
> > Thanks a lot Fernando,
> >
> > Effectively, it doesn't seem to work, unless I'm doing something wrong.
>
> Small bug, here's the fix.  Let me know if it works (as you noticed, this
> code
> has seen precious little testing):
>
> Index: ipython1/kernel/controllervanilla.py
> ===================================================================
> --- ipython1/kernel/controllervanilla.py        (revision 2018)
> +++ ipython1/kernel/controllervanilla.py        (working copy)
> @@ -169,7 +169,7 @@
>
>           self.pushAll(tar_fileString=fileString)
>           self.executeAll("tar_file = open('%s','wb')" % \
> -            tarball_name, block=False)
> +            tarballName, block=False)
>           self.executeAll("tar_file.write(tar_fileString)", block=False)
>           self.executeAll("tar_file.close()", block=False)
>           self.executeAll("import os", block=False)
>
>
> I've already committed it, so you can either apply it manually or update
> your
> SVN checkout.
>
> For future discussions on this, I'd really appreciate it if you could use
> the
> list.  Much of this code has not been written by me directly, so it's
> critical
> that we get other developers' feedback as well.
>
> Thanks for the report!
>
> Cheers,
>
> f
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070118/d7da63db/attachment.html>


More information about the IPython-dev mailing list