[IPython-dev] %install_ext question

Thomas Kluyver takowl@gmail....
Wed Apr 3 07:36:15 CDT 2013

On 3 April 2013 13:12, Greg Novak <greg.novak@gmail.com> wrote:

> It does indeed put the file into .ipython/extensions, but then to use it I
> need to put the zip file in sys.path explicitly.  Just having the zip file
> in the extensions directory isn't enough.  So if I also do:
> import sys
> sys.path += ["/Users/novak/.ipython/extensions/grasp.zip"]

Is the zip file itself importable? i.e. if you put the directory containing
the zip file on your PYTHONPATH, can you do 'import grasp'? I think it
needs to be structured so that the top level of the zip file contains an
__init__.py file.

But it's fine to install using pip instead - it's a deliberate feature that
an extension is simply any importable module with a
load_ipython_extension() function at the top level. Sympy, for example,
includes an IPython extension as part of its installation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20130403/3097e9a8/attachment.html 

More information about the IPython-dev mailing list