Module for policy 'MemoizationPolicy' could not be loaded

Hi there

After installing rasa, I tried to run ‘rasa train’ and got the following error: Module for policy ‘MemoizationPolicy’ could not be loaded. Please make sure the name is a valid policy.

Please help. Thanks.

Managed to fix the issue. I had some outdated packages.

Hi there.

I have the same issue (among others) since last weekend. I also tried to upgrade the packages (for python3.7). But after that, I got a lot of other errors and the more I tried to fix them, the worse it got. I was never able to install rasa correctly again.

Now I have python 3.6.9 running. I was able to install rasa and rasa X with only one single outdated package, the httplib2. Again, when I try to run rasa (with “rasa init” command) it gives this same error again.

The thing is, if I just try to upgrade this package, it comes the error saying it’s a “distutils project” and can’t be accurately uninstalled. If I try to do it with the option --ignore-installed, it installs the 0.9.2 version. But that everything get bad and come alot of errors like I mentioned above.

Any Ideas of how to upgrade this package without ignored the installed one (and not getting the “distutils project” error anymore) are appreciated.

Thanks in advance.

Hi

If you need to upgrade to a specific version, you can try using:

pip install somepackage == version 

You can uninstall a package using:

pip uninstall somepackage 

Hi Maks,

Thanks for your reply. I tried exactly that. In this case it is: pip install httplib2==0.9.2,

That’s when I get this: “(…) Successfully built httplib2 Installing collected packages: httplib2 Found existing installation: httplib2 0.9.1 ERROR: Cannot uninstall ‘httplib2’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.”

This is where I get stucked. Did you have this same error with “httplib2”?

Just to mention that if I try to uninstall “httplib2”, it also comes the same error.

I experience the same issue. I just started with Rasa and followed the getting started guide. Everything seems to be up to date. Any idea what I could try?

How did you solve this error

These are the Errors Traceback (most recent call last): File “c:\users\user\desktop\rasaproject\venv1\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\rasaproject\venv1\lib\site-packages\rasa\utils\common.py”, line 204, 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\rasaproject\venv1\lib\site-packages\rasa\core\policies\registry.py”, line 5, in from rasa.core.policies.ted_policy import TEDPolicy File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\core\policies\ted_policy.py”, line 26, in from rasa.utils.tensorflow.models import RasaModel File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\utils\tensorflow\models.py”, line 8, in from rasa.utils.tensorflow.model_data import RasaModelData, FeatureSignature File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\utils\tensorflow\model_data.py”, line 7, in from sklearn.model_selection import train_test_split File "c:\users\user\desktop\rasaproject\venv1\lib\site-packages\sklearn_init.py", line 82, in from .base import clone File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\sklearn\base.py”, line 20, in from .utils import IS_32BIT File "c:\users\user\desktop\rasaproject\venv1\lib\site-packages\sklearn\utils_init.py", line 27, in from .fixes import np_version File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\sklearn\utils\fixes.py”, line 18, in import scipy.stats File "c:\users\user\desktop\rasaproject\venv1\lib\site-packages\scipy\stats_init.py", line 384, in from .stats import * File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\scipy\stats\stats.py”, line 179, in from scipy.spatial.distance import cdist File "c:\users\user\desktop\rasaproject\venv1\lib\site-packages\scipy\spatial_init.py", line 102, in from .procrustes import procrustes File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\scipy\spatial_procrustes.py”, line 11, in from scipy.linalg import orthogonal_procrustes File "c:\users\user\desktop\rasaproject\venv1\lib\site-packages\scipy\linalg_init.py", line 195, in from .misc import * File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\scipy\linalg\misc.py”, line 5, in from .blas import get_blas_funcs File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\scipy\linalg\blas.py”, line 215, in from scipy.linalg import _fblas 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\rasaproject\venv1\lib\site-packages\rasa\core\policies\ensemble.py”, line 308, in from_dict constr_func = registry.policy_from_module_path(policy_name) File “c:\users\user\desktop\rasaproject\venv1\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\RasaProject\venv1\Scripts\rasa.exe_main.py", line 7, in File "c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa_main.py", line 91, in main cmdline_arguments.func(cmdline_arguments) File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\cli\scaffold.py”, line 209, in run init_project(args, path) File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\cli\scaffold.py”, line 121, in init_project print_train_or_instructions(args, path) File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\cli\scaffold.py”, line 58, in print_train_or_instructions args.model = rasa.train(domain, config, training_files, output) File “c:\users\user\desktop\rasaproject\venv1\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\rasaproject\venv1\lib\site-packages\rasa\train.py”, line 101, in train_async additional_arguments, File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\train.py”, line 188, in _train_async_internal additional_arguments=additional_arguments, File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\train.py”, line 223, in _do_training additional_arguments=additional_arguments, File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\train.py”, line 361, in _train_core_with_validated_data additional_arguments=additional_arguments, File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\core\train.py”, line 43, in train policies = config.load(policy_config) File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\core\config.py”, line 28, in load return PolicyEnsemble.from_dict(config_data) File “c:\users\user\desktop\rasaproject\venv1\lib\site-packages\rasa\core\policies\ensemble.py”, line 319, 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.

and pip install somepackage==

(without any version) to find out what versions are available

:arrow_forward: pip install rasa==

ERROR: Could not find a version that satisfies the requirement rasa== (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.1.0, 0.1.1, 0.2.0a2, 0.2.0a3, 0.14.0a5, 0.14.0a6, 0.14.0a7, 0.14.0a8, 0.14.0a9, 0.15.0a6, 1.0.0a1, 1.0.0a2, 1.0.0a3, 1.0.0a4, 1.0.0a5, 1.0.0rc1, 1.0.0rc2, 1.0.0rc3, 1.0.0rc4, 1.0.0rc5, 1.0.0rc6, 1.0.0rc7, 1.0.0rc8, 1.0.0rc9, 1.0.0rc10, 1.0.0rc11, 1.0.0rc12, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.2.0a2, 1.2.0a3, 1.2.0a4, 1.2.0a5, 1.2.0a6, 1.2.0a7, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9, 1.2.10, 1.2.11, 1.2.12, 1.3.0a1, 1.3.0a2, 1.3.0, 1.3.1a1, 1.3.1a3, 1.3.1a4, 1.3.1a5, 1.3.1a8, 1.3.1a10, 1.3.1a11, 1.3.1a12, 1.3.1a14, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.6, 1.3.7, 1.3.8, 1.3.9, 1.3.10, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.6.0a1, 1.6.0a2, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.8.0)

Hi zameerhossain,

Sorry for the delay. Since the end of October I didn’t deal with Rasa until now. So I can’t remember exactly the details of what I did. What I can say is that I reinstalled Python 3.6 (since I tried even with 3.8 and that caused a larger mess). After reinstalling this version and then pip for this version, I followed the steps from Rasa and RasaX. Then it worked. But can’t say what was the difference. It just worked. I didn’t mess around with httplib2 anymore.

Sorry that I can’t give you a better help on this.

Try using rasa-x rather than rasa library:

virtualenv -p 3.6.8 rasaenvx

rasaenvx\Scripts\activate

pip3 install rasa-x --extra-index-url https://pypi.rasa.com/simple

rasa init --no-prompt

Even I needed help with this. I upgraded to the new rasa core but it ended up causing more trouble. So I reverted back to 1.5.3 and now it gives me the error you’ve pointed out. If you have resolved this issue, please help me out.