Error using Rasa

Hi!, I got this error when trying to run Rasa in my local

2021-04-12 19:04:03.226110: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2021-04-12 19:04:08.953817: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2021-04-12 19:04:08.953853: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303)
2021-04-12 19:04:08.953881: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (mariasanz): /proc/driver/nvidia/version does not exist
Traceback (most recent call last):
  File "/home/mariasanz/venv/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/__main__.py", line 116, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/cli/data.py", line 254, in validate_files
    validator = rasa.utils.common.run_in_loop(Validator.from_importer(file_importer))
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/utils/common.py", line 308, in run_in_loop
    result = loop.run_until_complete(f)
  File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/validator.py", line 52, in from_importer
    domain = await importer.get_domain()
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/shared/importers/rasa.py", line 67, in get_domain
    domain = Domain.load(self._domain_path)
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/shared/core/domain.py", line 123, in load
    other = cls.from_path(path)
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/shared/core/domain.py", line 133, in from_path
    domain = cls.from_file(path)
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/shared/core/domain.py", line 146, in from_file
    return cls.from_yaml(rasa.shared.utils.io.read_file(path), path)
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/shared/core/domain.py", line 152, in from_yaml
    yaml, rasa.shared.constants.DOMAIN_SCHEMA_FILE
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/shared/utils/validation.py", line 144, in validate_yaml_schema
    yaml_file_content, reader_type=["safe", "rt"]
  File "/home/mariasanz/venv/lib/python3.6/site-packages/rasa/shared/utils/io.py", line 335, in read_yaml
    yaml_parser = yaml.YAML(typ=reader_type)
  File "/home/mariasanz/venv/lib/python3.6/site-packages/ruamel/yaml/main.py", line 138, in __init__
    'typ "{}"not recognised (need to install plug-in?)'.format(self.typ)
NotImplementedError: typ "['safe', 'rt']"not recognised (need to install plug-in?)

Any idea of how can I fix it? Thanks

Hi, could you share your domain file? Looks like there is some unrecognized option in there.

Thanks for help.

I have alredy solved it uninstalling rasa-x and starting again, then i had to make some changes on python config.

1 Like

Glad to hear it!

Hello , I have the same issue when I run rasa train nlu it gives me this error : ‘typ "{}"not recognised (need to install plug-in?)’.format(self.typ) NotImplementedError: typ "[‘safe’, ‘rt’]"not recognised (need to install plug-in?)

Hi @Hanane, looks like this might be a dependency issue. What’s your ruamel version?

Hi @fkoerner thak you for your response , I have 0.16 as a version

Could you run poetry update? You should have ruamel.yaml = "^0.16.5" (see the pyproject.toml file)

thank you @fkoerner I install poetry , this issue I have it when I want to add a new custom component , when I run rasa train nlu it doesn’t give me this error but it doesn’t know my component this is the steps that I followed I am using rasa 2.0 i create a python package inside the rasa nlu folder with the name of customcomponent inside of it I create a file sentiment.py . in the registr.py i do an import : from rasa.nlu.customcomponent import SentimentAnalyzer , I add the name of the class SentimentAnalyzer, in the component_classes list and I add this component in the config.yml : - name: sentiment.SentimentAnalyzer but It gives me this error : ModuleNotFoundError: No module named ‘sentiment’ can you help me please ?

Hi @Hanane did you add the path to the component to your python path? What python version are you on?

Hi @fkoerner this I add the path of my component in python path : with this command in the terminal : export PYTHONPATH=“${PYTHONPATH}:/Bureau/bot_projet/chatbot/lib/python3.6/site-packages/rasa/nlu/customcomponent/sentiment.py” , chatbot is my virtual environnement . the output of echo $PYTHONPATH is :/Bureau/bot_projet/chatbot/lib/python3.6/site-packages/rasa/nlu/customcomponent/sentiment.py. But still give me this error : ModuleNotFoundError: No module named ‘sentiment’ to recapitulate my configuration - in config.yml : pipeline:

  • name: SpacyNLP model: “fr_core_news_sm”
  • name: SpacyTokenizer “intent_tokenization_flag”: True
  • name: sentiment.SentimentAnalyzer
  • name: SpacyFeaturizer
  • in rasa/nlu/registry.py:
  • if typing.TYPE_CHECKING:
  • List item

from rasa.nlu.components import Component

from rasa.nlu.config import RasaNLUModelConfig

from rasa.nlu.customcomponent import SentimentAnalyzer

logger = logging.getLogger(name)

and I add the name of the class : component_classes = [ …

SentimentAnalyzer,

]

  • my python version is Python 3.6.9

Hi, you need to add the path to the directory of sentiment.py, not the path including the file. So instead of adding

/Bureau/bot_projet/chatbot/lib/python3.6/site-packages/rasa/nlu/customcomponent/sentiment.py

you should add:

/Bureau/bot_projet/chatbot/lib/python3.6/site-packages/rasa/nlu/customcomponent