Issues of Rasa Init

Hi, When I ran the following command in virtual environment: rasa init --no-prompt I got the following exception:

Welcome to Rasa! 

To get started quickly, an initial project will be created.
If you need some help, check out the documentation at https://rasa.com/docs/rasa.

Created project directory at '/home/wilson'.
Finished creating project structure.
Training an initial model...
Training Core model...
Traceback (most recent call last):
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/registry.py", line 21, in policy_from_module_path
    module_path, lookup_path="rasa.core.policies.registry"
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/utils/common.py", line 184, in class_from_module_path
    m = importlib.import_module(lookup_path)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/policies/registry.py", line 5, in <module>
    from rasa.core.policies.embedding_policy import EmbeddingPolicy
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/policies/embedding_policy.py", line 24, in <module>
    from rasa.utils import train_utils
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/utils/train_utils.py", line 9, in <module>
    from tensor2tensor.models.transformer import (
  File "/home/wilson/venv/lib/python3.6/site-packages/tensor2tensor/models/__init__.py", line 36, in <module>
    from tensor2tensor.models import mtf_transformer2
  File "/home/wilson/venv/lib/python3.6/site-packages/tensor2tensor/models/mtf_transformer2.py", line 23, in <module>
    from mesh_tensorflow.transformer import moe
  File "/home/wilson/venv/lib/python3.6/site-packages/mesh_tensorflow/transformer/__init__.py", line 23, in <module>
    import mesh_tensorflow.transformer.dataset
  File "/home/wilson/venv/lib/python3.6/site-packages/mesh_tensorflow/transformer/dataset.py", line 94, in <module>
    import tensorflow_datasets as tfds
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/__init__.py", line 46, in <module>
    from tensorflow_datasets.core import tf_compat
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/__init__.py", line 25, in <module>
    from tensorflow_datasets.core.dataset_builder import BeamBasedBuilder
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/dataset_builder.py", line 35, in <module>
    from tensorflow_datasets.core import download
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/download/__init__.py", line 19, in <module>
    from tensorflow_datasets.core.download.download_manager import DownloadConfig
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/download/download_manager.py", line 34, in <module>
    from tensorflow_datasets.core.download import downloader
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/download/downloader.py", line 33, in <module>
    from requests.utils import extract_zipped_paths
ImportError: cannot import name 'extract_zipped_paths'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/policies/ensemble.py", line 320, in from_dict
    constr_func = registry.policy_from_module_path(policy_name)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/registry.py", line 24, in policy_from_module_path
    raise ImportError("Cannot retrieve policy from path '{}'".format(module_path))
ImportError: Cannot retrieve policy from path 'MemoizationPolicy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wilson/venv/bin/rasa", line 11, in <module>
    sys.exit(main())
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/cli/scaffold.py", line 195, in run
    init_project(args, path)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/cli/scaffold.py", line 113, in init_project
    print_train_or_instructions(args, path)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/cli/scaffold.py", line 50, in print_train_or_instructions
    args.model = rasa.train(domain, config, training_files, output)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 40, in train
    kwargs=kwargs,
  File "uvloop/loop.pyx", line 1417, in uvloop.loop.Loop.run_until_complete
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 91, in train_async
    kwargs,
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 175, in _train_async_internal
    kwargs=kwargs,
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 210, in _do_training
    kwargs=kwargs,
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 339, in _train_core_with_validated_data
    kwargs=kwargs,
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/train.py", line 42, in train
    policies = config.load(policy_config)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/config.py", line 28, in load
    return PolicyEnsemble.from_dict(config_data)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/policies/ensemble.py", line 328, in from_dict
    "".format(policy_name)
rasa.core.policies.ensemble.InvalidPolicyConfig: Module for policy 'MemoizationPolicy' could not be loaded. Please make sure the name is a valid policy.
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/registry.py", line 21, in policy_from_module_path
    module_path, lookup_path="rasa.core.policies.registry"
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/utils/common.py", line 184, in class_from_module_path
    m = importlib.import_module(lookup_path)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/policies/registry.py", line 5, in <module>
    from rasa.core.policies.embedding_policy import EmbeddingPolicy
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/policies/embedding_policy.py", line 24, in <module>
    from rasa.utils import train_utils
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/utils/train_utils.py", line 9, in <module>
    from tensor2tensor.models.transformer import (
  File "/home/wilson/venv/lib/python3.6/site-packages/tensor2tensor/models/__init__.py", line 36, in <module>
    from tensor2tensor.models import mtf_transformer2
  File "/home/wilson/venv/lib/python3.6/site-packages/tensor2tensor/models/mtf_transformer2.py", line 23, in <module>
    from mesh_tensorflow.transformer import moe
  File "/home/wilson/venv/lib/python3.6/site-packages/mesh_tensorflow/transformer/__init__.py", line 23, in <module>
    import mesh_tensorflow.transformer.dataset
  File "/home/wilson/venv/lib/python3.6/site-packages/mesh_tensorflow/transformer/dataset.py", line 94, in <module>
    import tensorflow_datasets as tfds
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/__init__.py", line 46, in <module>
    from tensorflow_datasets.core import tf_compat
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/__init__.py", line 25, in <module>
    from tensorflow_datasets.core.dataset_builder import BeamBasedBuilder
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/dataset_builder.py", line 35, in <module>
    from tensorflow_datasets.core import download
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/download/__init__.py", line 19, in <module>
    from tensorflow_datasets.core.download.download_manager import DownloadConfig
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/download/download_manager.py", line 34, in <module>
    from tensorflow_datasets.core.download import downloader
  File "/home/wilson/venv/lib/python3.6/site-packages/tensorflow_datasets/core/download/downloader.py", line 33, in <module>
    from requests.utils import extract_zipped_paths
ImportError: cannot import name 'extract_zipped_paths'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/policies/ensemble.py", line 320, in from_dict
    constr_func = registry.policy_from_module_path(policy_name)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/registry.py", line 24, in policy_from_module_path
    raise ImportError("Cannot retrieve policy from path '{}'".format(module_path))
ImportError: Cannot retrieve policy from path 'MemoizationPolicy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wilson/venv/bin/rasa", line 11, in <module>
    sys.exit(main())
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/cli/scaffold.py", line 195, in run
    init_project(args, path)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/cli/scaffold.py", line 113, in init_project
    print_train_or_instructions(args, path)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/cli/scaffold.py", line 50, in print_train_or_instructions
    args.model = rasa.train(domain, config, training_files, output)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 40, in train
    kwargs=kwargs,
  File "uvloop/loop.pyx", line 1417, in uvloop.loop.Loop.run_until_complete
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 91, in train_async
    kwargs,
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 175, in _train_async_internal
    kwargs=kwargs,
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 210, in _do_training
    kwargs=kwargs,
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/train.py", line 339, in _train_core_with_validated_data
    kwargs=kwargs,
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/train.py", line 42, in train
    policies = config.load(policy_config)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/config.py", line 28, in load
    return PolicyEnsemble.from_dict(config_data)
  File "/home/wilson/venv/lib/python3.6/site-packages/rasa/core/policies/ensemble.py", line 328, in from_dict
    "".format(policy_name)
rasa.core.policies.ensemble.InvalidPolicyConfig: Module for policy 'MemoizationPolicy' could not be loaded. Please make sure the name is a valid policy.
(venv) wilson@wilson-VirtualBox:~$ 

Moreover, my rasa version is:

(venv) wilson@wilson-VirtualBox:~$ pip show rasa
---
Metadata-Version: 2.1
Name: rasa
Version: 1.3.9
Summary: Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
Home-page: https://rasa.com
Author: Rasa Technologies GmbH
Author-email: hi@rasa.com
Installer: pip
License: Apache 2.0
Location: /home/wilson/venv/lib/python3.6/site-packages
Requires: colorhash, tensorflow-probability, kafka-python, python-telegram-bot, numpy, coloredlogs, mattermostwrapper, python-engineio, gast, tensorflow, webexteamssdk, attrs, tqdm, redis, simplejson, setuptools, pykwalify, packaging, pytz, scipy, networkx, pika, aiohttp, ruamel.yaml, pydot, SQLAlchemy, requests, sklearn-crfsuite, python-dateutil, jsonpickle, matplotlib, jsonschema, twilio, terminaltables, sanic, questionary, PyJWT, tensor2tensor, apscheduler, gevent, rasa-sdk, sanic-jwt, scikit-learn, slackclient, rocketchat-API, fbmessenger, boto3, colorclass, async-generator, sanic-cors, pymongo, absl-py, scikit-learn, python-socketio
Classifiers:
  Development Status :: 4 - Beta
  Intended Audience :: Developers
  License :: OSI Approved :: Apache Software License
  Programming Language :: Python
  Programming Language :: Python :: 3.5
  Programming Language :: Python :: 3.6
  Programming Language :: Python :: 3.7
  Topic :: Software Development :: Libraries
Entry-points:
  [console_scripts]
  rasa = rasa.__main__:main
You are using pip version 8.1.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) wilson@wilson-VirtualBox:~$ 

Please advise. Thanks.

Regards, Wilson

Hi @wilson, I guess it is related to ImportError: cannot import name 'extract_zipped_paths'. I installed rasa 1.3.9 myself and run rasa init --no-prompt and everything was working as expected.

Is your request package up-to-date? Can you maybe try to remove it and install it again?

Hi Tanja,

I am new to Rasa and Python. Please let me know how to update the request package. Thanks.

Regards, Wilson

Execute the following in your virtualenv.

pip uninstall requests
pip install requests

Hi Tanja,

Thank for your info. After upgrading requests, I still stuck in rasa init command.
Details:


(venv) wilson@wilson-VirtualBox:~$  pip uninstall requests
Not uninstalling requests at /usr/lib/python3/dist-packages, outside environment /home/wilson/venv
Can't uninstall 'requests'. No files were found to uninstall.
(venv) wilson@wilson-VirtualBox:~$  pip install requests
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.9.1)
(venv) wilson@wilson-VirtualBox:~$ rasa init --no-prompt
File "/home/wilson/venv/lib/python3.6/site-packages/requests_async/sessions.py", line 13, in <module>
    from requests.utils import requote_uri, rewind_body
ImportError: cannot import name 'rewind_body'

I am using Ubuntu 16. Please help.

Regards, Wilson

Did you try removing your virtualenv and to

  1. create a new virtualenv based on python3.6, e.g. virtualenv -p python3.6 rasaenv if you are using virtualenv
  2. activate virtualenv
  3. install rasa via pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple

Sometimes it helps to create a new virtualenv to avoid conflicting versions. Does it help?

Hi Tanja,

I have a similar problem with the policies (and other errors). I made the three steps you wrote here and I found no issues. When I tried again to run rasa init --no-prompt, it comes out this:

(...)
Created project directory at '/home/somedirectory'.
Finished creating project structure.
Training an initial model...
Training Core model...
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/registry.py", line 21, in policy_from_module_path
    module_path, lookup_path="rasa.core.policies.registry"
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/common.py", line 184, in class_from_module_path
    m = importlib.import_module(lookup_path)
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/policies/registry.py", line 5, in <module>
    from rasa.core.policies.embedding_policy import EmbeddingPolicy
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/policies/embedding_policy.py", line 24, in <module>
    from rasa.utils import train_utils
  File "/usr/local/lib/python3.6/dist-packages/rasa/utils/train_utils.py", line 9, in <module>
    from tensor2tensor.models.transformer import (
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/models/__init__.py", line 61, in <module>
    from tensor2tensor.models.research import rl
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/models/research/rl.py", line 24, in <module>
    from tensor2tensor.data_generators import gym_env
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/data_generators/gym_env.py", line 33, in <module>
    from tensor2tensor.rl import gym_utils
  File "/usr/local/lib/python3.6/dist-packages/tensor2tensor/rl/gym_utils.py", line 26, in <module>
    from PIL import Image
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 66, in <module>
    from PIL import _imaging as core
ImportError: cannot import name '_imaging'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/policies/ensemble.py", line 320, in from_dict
    constr_func = registry.policy_from_module_path(policy_name)
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/registry.py", line 24, in policy_from_module_path
    raise ImportError("Cannot retrieve policy from path '{}'".format(module_path))
ImportError: Cannot retrieve policy from path 'MemoizationPolicy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/rasa/__main__.py", line 76, in main
    cmdline_arguments.func(cmdline_arguments)
  File "/usr/local/lib/python3.6/dist-packages/rasa/cli/scaffold.py", line 195, in run
    init_project(args, path)
  File "/usr/local/lib/python3.6/dist-packages/rasa/cli/scaffold.py", line 113, in init_project
    print_train_or_instructions(args, path)
  File "/usr/local/lib/python3.6/dist-packages/rasa/cli/scaffold.py", line 50, in print_train_or_instructions
    args.model = rasa.train(domain, config, training_files, output)
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 45, in train
    kwargs=kwargs,
  File "uvloop/loop.pyx", line 1417, in uvloop.loop.Loop.run_until_complete
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 96, in train_async
    kwargs,
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 182, in _train_async_internal
    kwargs=kwargs,
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 217, in _do_training
    kwargs=kwargs,
  File "/usr/local/lib/python3.6/dist-packages/rasa/train.py", line 346, in _train_core_with_validated_data
    kwargs=kwargs,
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/train.py", line 43, in train
    policies = config.load(policy_config)
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/config.py", line 28, in load
    return PolicyEnsemble.from_dict(config_data)
  File "/usr/local/lib/python3.6/dist-packages/rasa/core/policies/ensemble.py", line 328, in from_dict
    "".format(policy_name)
rasa.core.policies.ensemble.InvalidPolicyConfig: Module for policy 'MemoizationPolicy' could not be loaded. Please make sure the name is a valid policy.

It still creates the project directory, but then come all of these. By checking the version comes out this:

(rasavenv) devugees@devugees-fbw-8-10:~$ pip show rasa
Name: rasa
Version: 1.4.0
Summary: Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
Home-page: https://rasa.com
Author: Rasa Technologies GmbH
Author-email: hi@rasa.com
License: Apache 2.0
Location: /usr/local/lib/python3.6/dist-packages
Requires: python-engineio, sanic-jwt, boto3, aiohttp, jsonschema, mattermostwrapper, questionary, tensorflow-probability, sanic-cors, slackclient, numpy, absl-py, async-generator, kafka-python, pydot, tensorflow, networkx, sanic, tqdm, packaging, python-socketio, pykwalify, rasa-sdk, setuptools, jsonpickle, pika, scikit-learn, colorclass, webexteamssdk, tensor2tensor, scipy, fbmessenger, twilio, terminaltables, PyJWT, apscheduler, ruamel.yaml, rocketchat-API, matplotlib, requests, scikit-learn, gast, sklearn-crfsuite, colorhash, pytz, coloredlogs, pymongo, python-dateutil, python-telegram-bot, attrs, SQLAlchemy, gevent, redis
Required-by: rasa-x

Any help on this, I appreciate it.

Best regards,

Hi Tanja,

Thank for your useful commands. They work.

However, I encountered another problem when I tested the simple chatbot by following Rasa Tutorial.


Details: 2019-10-29 09:57:44 INFO root - Starting Rasa server on http://localhost:5005 2019-10-29 09:57:50 INFO absl - Entry Point [tensor2tensor.envs.tic_tac_toe_env:TicTacToeEnv] registered with id [T2TEnv-TicTacToeEnv-v0] Bot loaded. Type a message and press enter (use /stop to exit): Your input -> hi
2019-10-29 09:58:02 ERROR asyncio - Task exception was never retrieved future: <Task finished coro=<configure_app..run_cmdline_io() done, defined at /home/wilson/rasaenv/lib/python3.6/site-packages/rasa/core/run.py:123> exception=ClientConnectorError(ConnectionKey(host=localhost, port=5005, is_ssl=False, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=None), ConnectionRefusedError(111, Connection refused))> Traceback (most recent call last): File /home/wilson/rasaenv/lib/python3.6/site-packages/aiohttp/connector.py, line 936, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa File uvloop/loop.pyx, line 1927, in create_connection File uvloop/loop.pyx, line 1906, in uvloop.loop.Loop.create_connection ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File /home/wilson/rasaenv/lib/python3.6/site-packages/rasa/core/run.py, line 127, in run_cmdline_io server_url=constants.DEFAULT_SERVER_FORMAT.format(http, port) File /home/wilson/rasaenv/lib/python3.6/site-packages/rasa/core/channels/console.py, line 135, in record_messages async for response in bot_responses: File /home/wilson/rasaenv/lib/python3.6/site-packages/rasa/core/channels/console.py, line 98, in send_message_receive_stream async with session.post(url, json=payload, raise_for_status=True) as resp: File /home/wilson/rasaenv/lib/python3.6/site-packages/aiohttp/client.py, line 1012, in aenter self._resp = await self._coro File /home/wilson/rasaenv/lib/python3.6/site-packages/aiohttp/client.py, line 483, in _request timeout=real_timeout File /home/wilson/rasaenv/lib/python3.6/site-packages/aiohttp/connector.py, line 523, in connect proto = await self._create_connection(req, traces, timeout) File /home/wilson/rasaenv/lib/python3.6/site-packages/aiohttp/connector.py, line 859, in _create_connection req, traces, timeout) File /home/wilson/rasaenv/lib/python3.6/site-packages/aiohttp/connector.py, line 1004, in _create_direct_connection raise last_exc File /home/wilson/rasaenv/lib/python3.6/site-packages/aiohttp/connector.py, line 986, in _create_direct_connection req=req, client_error=client_error) File /home/wilson/rasaenv/lib/python3.6/site-packages/aiohttp/connector.py, line 943, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:5005 ssl:default [Connection refused]


I had googled but could not find any solution. Please advise.

Regards, Wilson

Hi Tanja,

I finally solved my Rasa Shell problem by running the following command in virtual environment: sudo apt-get upgrade

Thanks a lot.

Regards, Wilson

I did It. But still I get Error.

Training Core model Traceback (most recent call last): File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\core\registry.py, line 21, in policy_from_module_path module_path, lookup_path=rasa.core.policies.registry File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\utils\common.py, line 208, in class_from_module_path m = importlib.import_module(lookup_path) File C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\importlib_init_.py, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File , line 1006, in _gcd_import File , line 983, in _find_and_load File , line 967, in _find_and_load_unlocked File , line 677, in load_unlocked File , line 728, in exec_module File , line 219, in call_with_frames_removed File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\core\policies\registry.py, line 5, in from rasa.core.policies.embedding_policy import EmbeddingPolicy File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\core\policies\embedding_policy.py, line 22, in from rasa.utils import train_utils File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\utils\train_utils.py, line 8, in from sklearn.model_selection import train_test_split File "c:\users\user\desktop\testbot\venv\lib\site-packages\sklearn_init.py", line 64, in from .base import clone File c:\users\user\desktop\testbot\venv\lib\site-packages\sklearn\base.py, line 14, in from .utils.fixes import signature File "c:\users\user\desktop\testbot\venv\lib\site-packages\sklearn\utils_init.py", line 16, in from .fixes import Sequence as Sequence File c:\users\user\desktop\testbot\venv\lib\site-packages\sklearn\utils\fixes.py, line 85, in from scipy.special import boxcox # noqa File "c:\users\user\desktop\testbot\venv\lib\site-packages\scipy\special_init.py", line 634, in from . import _ufuncs ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\core\policies\ensemble.py, line 320, in from_dict constr_func = registry.policy_from_module_path(policy_name) File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\core\registry.py, line 24, in policy_from_module_path raise ImportError(f"Cannot retrieve policy from path {module_path}") ImportError: Cannot retrieve policy from path MemoizationPolicy

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py, line 193, in run_module_as_main main, mod_spec) File C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\runpy.py, line 85, in run_code exec(code, run_globals) File "C:\Users\User\Desktop\TestBot\venv\Scripts\rasa.exe_main.py", line 9, in File "c:\users\user\desktop\testbot\venv\lib\site-packages\rasa_main.py", line 76, in main cmdline_arguments.func(cmdline_arguments) File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\cli\scaffold.py, line 197, in run init_project(args, path) File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\cli\scaffold.py, line 115, in init_project print_train_or_instructions(args, path) File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\cli\scaffold.py, line 52, in print_train_or_instructions args.model = rasa.train(domain, config, training_files, output) File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\train.py, line 50, in train additional_arguments=additional_arguments, File C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py, line 583, in run_until_complete return future.result() File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\train.py, line 101, in train_async additional_arguments, File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\train.py, line 188, in _train_async_internal additional_arguments=additional_arguments, File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\train.py, line 223, in _do_training additional_arguments=additional_arguments, File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\train.py, line 361, in _train_core_with_validated_data additional_arguments=additional_arguments, File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\core\train.py, line 44, in train policies = config.load(policy_config) File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\core\config.py, line 28, in load return PolicyEnsemble.from_dict(config_data) File c:\users\user\desktop\testbot\venv\lib\site-packages\rasa\core\policies\ensemble.py, line 331, in from_dict .format(policy_name) rasa.core.policies.ensemble.InvalidPolicyConfig: Module for policy MemoizationPolicy could not be loaded. Please make sure the name is a valid policy. Help please

conda create -n rasaenv python=3.7 anaconda ---- > set python 3.7

conda install tensorflow==2.1.0 -----> install tensorflow 2.1.0

pip install rasa==1.9.0 --> install rasa 1.9.0 version

these steps works for me.

If I give command like this : rasa train but it gives below error: No training data given. Please provide stories and NLU data in order to train a Rasa model using the data argument.

if I give command like this: python -m rasa train core -s data/stories.md -d domain.yml --config config.yml

Then it show error like this: rasa.core.policies.ensemble.InvalidPolicyConfig: Module for policy MemoizationPolicy could not be loaded. Please make sure the name is a valid policy.