diff --git a/spacy/errors.py b/spacy/errors.py index 16713d246..825fc1b35 100644 --- a/spacy/errors.py +++ b/spacy/errors.py @@ -177,7 +177,7 @@ class Errors(object): "you forget to call the `set_extension` method?") E047 = ("Can't assign a value to unregistered extension attribute " "'{name}'. Did you forget to call the `set_extension` method?") - E048 = ("Can't import language {lang} from spacy.lang.") + E048 = ("Can't import language {lang} from spacy.lang: {err}") E049 = ("Can't find spaCy data directory: '{path}'. Check your " "installation and permissions, or use spacy.util.set_data_path " "to customise the location if necessary.") diff --git a/spacy/util.py b/spacy/util.py index 26f3eac2b..621ea5935 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -53,8 +53,8 @@ def get_lang_class(lang): if lang not in LANGUAGES: try: module = importlib.import_module(".lang.%s" % lang, "spacy") - except ImportError: - raise ImportError(Errors.E048.format(lang=lang)) + except ImportError as err: + raise ImportError(Errors.E048.format(lang=lang, err=err)) LANGUAGES[lang] = getattr(module, module.__all__[0]) return LANGUAGES[lang]