ModuleNotFoundError: Cannot find class 'LexicalSyntacticFeaturizer' from global namespace

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.

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

hi @JiteshGaikwad using version 1.7

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

2 Likes

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

1 Like

Thanks @cheer :wink:

1 Like

@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 "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  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/train.py", line 474, in _train_nlu_with_validated_data
    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?

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

  • Python and pip verison
  • are you using anaconda
  • config.yml file
  • output of rasa --version

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

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

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

1 Like

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