ImportError: No module named base

Issue #943 wontfix
Nuno Dias
created an issue

I'm getting this error from .base import * ImportError: No module named base

while executing

and I checked every folder and 'descriptors' is the only one with import * in

I also found this ImageJ Jython guide

Comments (7)

  1. Nuno Dias reporter

    I actually just completed it. The way I made it work was to replace every * with the full list of classes in that file. There was some repetition. I couldn't make __all__ = ["mathTools", "stackProcessing"] work in the file with the classes, which would make the edits shorter and slightly more elegant...

  2. Benjamin Francisoud

    Just got the same bug :(

    The solution is do some trial/error to remove the wildcard import. I do agree that this is a Jython bug. I'm no python guru but according to the python official documentation I should frown at you in that case ;)

    This imports all names except those beginning with an underscore (_). In most cases Python programmers do not use this facility since it introduces an unknown set of names into the interpreter, possibly hiding some things you have already defined. Note that in general the practice of importing * from a module or package is frowned upon, since it often causes poorly readable code. However, it is okay to use it to save typing in interactive sessions.


    @CharlieC if I provide a pull request, would you consider it ?

    It would fix our problem and you would be compliant with python ways of coding ;)

  3. CharlieC

    All pull requests will be considered.

    I think this is the only use of from x import * in the whole library and makes sense where it is. It is legitimate use and foolish consistency is the hobgoblin of tiny minds. Maybe there's a workaround with __all__? The code itself is unlikely to change much. It would be nice for type hinting to take advantage of the descriptors but I see this as a missed opportunity of the typing module. Oh well.

  4. Log in to comment