[IPython-dev] %install_ext question
Greg Novak
greg.novak at gmail.com
Wed Apr 3 08:12:37 EDT 2013
I am experimenting with different ways of installing an extension I wrote
(grasp, mentioned a few days ago on ipython-user). It contains multiple
files, so
%install_ext blah/blah.py won't work.
The documentation suggests that this will work:
%install_ext blah/blah/grasp.zip
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"]
then it works to say
%load_ext grasp
What's the intended behavior here? Is this supposed to work? At least for
me, it can be made to work either by having %install_ext extract the zip
file into the extensions directory or else have %install_ext put code into
the ipython startup files that explicitly add the zip file to sys.path.
For the moment, my extension is installable via "pip install grasp" so it's
not a huge deal if it can't be installed via %install_ext.
I found the information about using %install_ext on zip files in the
docstring for install_ext.
Thanks,
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130403/966c41c3/attachment.html>
More information about the IPython-dev
mailing list