Better error for some unresolved imports

When trying to import nonexistent items from existing modules, specify that
that is what happened, rather than just reporting "unresolved name".