ModuleNotFoundError: Cannot find class 'LexicalSyntacticFeaturizer' from global namespace - Getting Started with Rasa / Tutorials, Resources & Videos - Rasa Community Forum

👋 Introducing the Rasa Playground

[ModuleNotFoundError: Cannot find class ‘LexicalSyntacticFeaturizer’ from global namespace]

post by cheer on Mar 13, 2020

I am trying to run this example https://github.com/RasaHQ/rasa/tree/master/examples/formbot. Getting error on train :

ModuleNotFoundError: Cannot find class ‘LexicalSyntacticFeaturizer’ from global namespace. Please check that there is no typo in the class name and that you have imported the class into the global namespace.

Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/rasa/nlu/registry.py”, line 155, in get_component_class
return class_from_module_path(component_name)
File “/usr/local/lib/python3.7/site-packages/rasa/utils/common.py”, line 211, in class_from_module_path
raise ImportError(f"Cannot retrieve class from path {module_path}.")
ImportError: Cannot retrieve class from path LexicalSyntacticFeaturizer.


post by JiteshGaikwad on Mar 13, 2020

Hey @cheer, which version of Rasa r u using?

post by cheer on Mar 13, 2020

hai @JiteshGaikwad using version 1.7

post by JiteshGaikwad on Mar 13, 2020

Hey @cheer, LexicalSyntacticFeaturizer were added in Rasa 1.8, try upgrading Rasa to the latest version.

post by cheer on Mar 13, 2020

thanks for quick response @JiteshGaikwad. Between love your work on Chatbot Widget

post by JiteshGaikwad on Mar 13, 2020

Thanks @cheer

post by ganeshv on May 5, 2020

@JiteshGaikwad I’m using Rasa 1.8.0 and I’m still getting this error. Here’s the full error -

Traceback (most recent call last):
  File "/build/lib/python3.6/site-packages/rasa/nlu/registry.py", line 155, in get_component_class
    return class_from_module_path(component_name)
  File "/build/lib/python3.6/site-packages/rasa/utils/common.py", line 211, in class_from_module_path
    raise ImportError(f"Cannot retrieve class from path {module_path}.")
ImportError: Cannot retrieve class from path LexicalSyntacticFeaturizer.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/build/lib/python3.6/site-packages/rasa/__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/build/lib/python3.6/site-packages/rasa/cli/train.py", line 76, in train
    additional_arguments=extract_additional_arguments(args),
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 50, in train
    additional_arguments=additional_arguments,
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 101, in train_async
    additional_arguments,
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 188, in _train_async_internal
    additional_arguments=additional_arguments,
  File "/build/lib/python3.6/site-packages/rasa/train.py", line 245, in _do_training
    persist_nlu_training_data=persist_nlu_training_data,
  File "/build/lib/python3.6/site-packages/rasa/nlu/train.py", line 74, in train
    trainer = Trainer(nlu_config, component_builder)
  File "/build/lib/python3.6/site-packages/rasa/nlu/model.py", line 144, in __init__
    components.validate_requirements(cfg.component_names)
  File "/build/lib/python3.6/site-packages/rasa/nlu/components.py", line 39, in validate_requirements
    component_class = registry.get_component_class(component_name)
  File "/build/lib/python3.6/site-packages/rasa/nlu/registry.py", line 181, in get_component_class
    raise ModuleNotFoundError(exception_message)
ModuleNotFoundError: Cannot find class 'LexicalSyntacticFeaturizer' from global namespace. Please check that there is no typo in the class name and that you have imported the class into the global namespace.

Could you help resolve?

post by JiteshGaikwad on May 6, 2020

Hey @ganeshv, can you help me with below details:

post by nikamsau on Jun 4, 2020

Hey @JiteshGaikwad, I’m facing the same issue.
I’m using
python 3.6
pip version: 20.1.1
yes I’m using anaconda
rasa version : 1.9.4
Please do respond, asap

post by aoduru on Jun 7, 2020

I’m also having the same errors despite installing the transformer libraries

post by Ishan100 on Jan 23, 2021

Did we get any solution for this issue, I am also stuck with the same issue ?

post by bubjanes on Jun 23, 2021

It looks like it was an issue with the version of Rasa that Ramesh was using.