Cannot Train Initial Module on Startup due to Tensorflow Error

I am getting the following error when training the initial module of Rasa. For context, I followed the youtube guide for Rasa installation and I’ve used Anaconda to create a python environment. I am also using Python 3.6.6. Any ideas on how to fix this? Thanks in advance.

Error:

Traceback (most recent call last):

File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 64, in from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “C:\Users\gabri\anaconda3\envs\rasa\lib\runpy.py”, line 193, in run_module_as_main “main”, mod_spec) File “C:\Users\gabri\anaconda3\envs\rasa\lib\runpy.py”, line 85, in run_code exec(code, run_globals) File "C:\Users\gabri\anaconda3\envs\rasa\Scripts\rasa.exe_main.py", line 7, in File "C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa_main.py", line 117, in main cmdline_arguments.func(cmdline_arguments) File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa\cli\scaffold.py”, line 235, in run init_project(args, path) File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa\cli\scaffold.py”, line 130, in init_project print_train_or_instructions(args, path) File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa\cli\scaffold.py”, line 69, in print_train_or_instructions training_result = rasa.train(domain, config, training_files, output) File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa\api.py”, line 106, in train from rasa.model_training import train_async File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa\model_training.py”, line 22, in from rasa.nlu.model import Interpreter File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa\nlu\model.py”, line 14, in from rasa.nlu import components, utils File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa\nlu\components.py”, line 7, in import rasa.utils.train_utils File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa\utils\train_utils.py”, line 39, in from rasa.utils.tensorflow.callback import RasaTrainingLogger, RasaModelCheckpoint File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\rasa\utils\tensorflow\callback.py”, line 5, in import tensorflow as tf File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\tensorflow_init.py", line 41, in from tensorflow.python.tools import module_util as *module_util File "C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\tensorflow\pythoninit*.py”, line 40, in from tensorflow.python.eager import context File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\tensorflow\python\eager\context.py”, line 35, in from tensorflow.python import pywrap_tfe File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\tensorflow\python\pywrap_tfe.py”, line 28, in from tensorflow.python import pywrap_tensorflow File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 83, in raise ImportError(msg) ImportError: Traceback (most recent call last): File “C:\Users\gabri\anaconda3\envs\rasa\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 64, in from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

Failed to load the native TensorFlow runtime.

Hello @gabriel_colon32 ! Warm Welcome on Forum :bouquet:

Can you please just follow these steps and you will be able to install and run rasa open source!

  1. Install Anaconda ( you already have one)
  2. Open a base Anaconda powershell (base)
  3. Create the python 3.6 or 3.7 or 3.8 Conda environment as per your requirement using the following command.
 conda create --n rasa3 python=3.8
 conda activate rasa3
  1. Install rasa pip install rasa==2.8.1

check rasa --version

You will be able to see rasa and rasa-sdk install if not

  1. pip install rasa-sdk==2.8.1

Good Luck! Hope this will solve your issue or if you have any issue mention me @ nik202

Thank you for the welcome!

I tried your guide but I needed to install ujson and tensorflow first :frowning:

Is it something related to a version of Tensorflow?

Same error:

Traceback (most recent call last): File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 64, in from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\runpy.py”, line 193, in run_module_as_main “main”, mod_spec) File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\runpy.py”, line 85, in run_code exec(code, run_globals) File "C:\Users\gabri\anaconda3\envs\rasa-test\Scripts\rasa.exe_main.py", line 7, in File "C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa_main.py", line 117, in main cmdline_arguments.func(cmdline_arguments) File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa\cli\scaffold.py”, line 235, in run init_project(args, path) File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa\cli\scaffold.py”, line 130, in init_project print_train_or_instructions(args, path) File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa\cli\scaffold.py”, line 69, in print_train_or_instructions training_result = rasa.train(domain, config, training_files, output) File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa\api.py”, line 106, in train from rasa.model_training import train_async File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa\model_training.py”, line 22, in from rasa.nlu.model import Interpreter File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa\nlu\model.py”, line 14, in from rasa.nlu import components, utils File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa\nlu\components.py”, line 7, in import rasa.utils.train_utils File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa\utils\train_utils.py”, line 39, in from rasa.utils.tensorflow.callback import RasaTrainingLogger, RasaModelCheckpoint File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\rasa\utils\tensorflow\callback.py”, line 5, in import tensorflow as tf File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\tensorflow_init_.py”, line 41, in from tensorflow.python.tools import module_util as module_util File "C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\tensorflow\python_init.py", line 40, in from tensorflow.python.eager import context File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\tensorflow\python\eager\context.py”, line 35, in from tensorflow.python import pywrap_tfe File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\tensorflow\python\pywrap_tfe.py”, line 28, in from tensorflow.python import pywrap_tensorflow File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 83, in raise ImportError(msg) ImportError: Traceback (most recent call last): File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 64, in from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

Failed to load the native TensorFlow runtime.

@gabriel_colon32 Are you still following the Video? Yes or No ?

OR

This error occur when you followed my steps.

Please tell. Thank,s

Yes, I had to follow the video because I was getting an error when I followed your steps. To solve that I had to "conda install ujson "and “conda install tensorflow”. Then I was able to install rasa but I got the same error on the training.

The error I got with your steps:

Traceback (most recent call last): File “C:\Users\gabri\anaconda3\envs\rasa-test\Scripts\pip-script.py”, line 6, in from pip._internal.cli.main import main File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_internal\cli\main.py”, line 9, in from pip._internal.cli.autocompletion import autocomplete File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_internal\cli\autocompletion.py”, line 10, in from pip._internal.cli.main_parser import create_main_parser File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_internal\cli\main_parser.py”, line 8, in from pip._internal.cli import cmdoptions File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_internal\cli\cmdoptions.py”, line 23, in from pip._internal.cli.parser import ConfigOptionParser File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_internal\cli\parser.py”, line 12, in from pip._internal.configuration import Configuration, ConfigurationError File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_internal\configuration.py”, line 21, in from pip._internal.exceptions import ( File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_internal\exceptions.py”, line 8, in from pip.vendor.requests.models import Request, Response File "C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_vendor\requests_init.py", line 43, in from pip.vendor import urllib3 File "C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_vendor\urllib3_init.py", line 13, in from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_vendor\urllib3\connectionpool.py”, line 40, in from .response import HTTPResponse File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_vendor\urllib3\response.py”, line 157, in class HTTPResponse(io.IOBase): File “C:\Users\gabri\anaconda3\envs\rasa-test\lib\site-packages\pip_vendor\urllib3\response.py”, line 390, in HTTPResponse DECODER_ERROR_CLASSES += (brotli.error,) AttributeError: module ‘brotli’ has no attribute ‘error’

@gabriel_colon32 While following my steps you getting error? Strange.

If you able to install rasa share rasa --version while typing on environment and share the screenshot please.