Added check for ImportError in _guess