skimage module not found by iPython's completion?

Tony Yu tsyu80 at gmail.com
Mon Feb 6 14:12:56 EST 2012


On Mon, Feb 6, 2012 at 12:43 PM, Michael Aye <kmichael.aye at gmail.com> wrote:

> Hi all,
>
> I noticed some weirds things with iPython's completion regarding
> skimage v0.12.
> When typing 'import sk' and then pressing <tab> to complete the import
> line, iPython cannot find skimage.
> But if I type 'import skimage' on my own, it works.
> Then, I type 'skimage.' and press <tab> to inspect the module, and I
> get:
>
> skimage.data_dir      skimage.img_as_int    skimage.pkg_dir
> skimage.util
> skimage.get_log       skimage.img_as_ubyte  skimage.test
> skimage.version
> skimage.img_as_float  skimage.img_as_uint   skimage.test_verbose
>
> (= half missing).
>
> Anybody knows what's going on here? I'm puzzled...
>
> Best regards,
> Michael


Huh, I guess I didn't notice this first issue until you mentioned it. Turns
out<http://stackoverflow.com/questions/1552961/ipython-tab-completes-only-some-modules>there's
an easy fix: Run `%rehashx` in ipython to rebuild the database of
known modules.

As for the second issue: We don't automatically import any subpackages
(other than `util`). This was a design decision since automatic imports of
all subpackages would increase load times (there may be other reasons too).
On the other hand, if you just want to see which submodules are available
for import, you can write `import skimage.<tab>` (note the dot before
<tab>) or `from skimage import<tab>` in ipython.

Hope that helps,
-Tony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20120206/b8a7f351/attachment.html>


More information about the scikit-image mailing list