ModuleNotFoundError: No module named 'keras'

I am using anaconda prompt. I want to run rasa. I have installed successfully keras in system as well as in virtual environments too, using command **conda install keras** .
But when I run the command **rasa init** then in NLU traing It gives me an error for ModuleNotFound: keras. What should I do resolve this error and successfully run the rasa chatbot?

I have checked that keras2.4.3 is installed in both my system and virtual environment using command **conda list**.

My Rasa version is Rasa Version : 2.8.12 Minimum Compatible Version: 2.8.9 Rasa SDK Version : 2.8.2 Rasa X Version : None Python Version : 3.8.3 Operating System : Windows-10-10.0.19041-SP0 Python Path : C:\Python39\python.exe

Error I am getting when running **rasa init** command:
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.
Now let's start! 👇🏽

? Please enter a path where the project will be created [default: current directory] .
? Directory 'C:\Users\om sai infotech\OneDrive\Desktop\organization_BOT(complete_dynamic)\organization_BOT\bot' is not empty. Continue? Yes
Created project directory at 'C:\Users\om sai infotech\OneDrive\Desktop\organization_BOT(complete_dynamic)\organization_BOT\bot'.
Finished creating project structure.
? Do you want to train an initial model? 💪🏽 Yes
Training an initial model...
The configuration for pipeline and policies was chosen automatically. It was written into the config file at '.\config.yml'.
2021-11-10 18:58:11 INFO rasa.model - Data (domain) for Core model section changed.
2021-11-10 18:58:11 INFO rasa.model - Data (messages) for NLU model section changed.
2021-11-10 18:58:11 INFO rasa.model  strong text- Data (nlg) for NLG responses section changed.
Training NLU model...
Traceback (most recent call last):
  File "C:\Python39\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\Scripts\rasa.exe\__main__.py", line 7, in <module>
  File "C:\Python39\lib\site-packages\rasa\__main__.py", line 118, in main
    cmdline_arguments.func(cmdline_arguments)
  File "C:\Python39\lib\site-packages\rasa\cli\scaffold.py", line 235, in run
    init_project(args, path)
  File "C:\Python39\lib\site-packages\rasa\cli\scaffold.py", line 130, in init_project
    print_train_or_instructions(args, path)
  File "C:\Python39\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:\Python39\lib\site-packages\rasa\api.py", line 109, in train
    return rasa.utils.common.run_in_loop(
  File "C:\Python39\lib\site-packages\rasa\utils\common.py", line 296, in run_in_loop
    result = loop.run_until_complete(f)
  File "C:\Python39\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:\Python39\lib\site-packages\rasa\model_training.py", line 108, in train_async
    return await _train_async_internal(
  File "C:\Python39\lib\site-packages\rasa\model_training.py", line 288, in _train_async_internal
    await _do_training(
  File "C:\Python39\lib\site-packages\rasa\model_training.py", line 334, in _do_training
    model_path = await _train_nlu_with_validated_data(
  File "C:\Python39\lib\site-packages\rasa\model_training.py", line 758, in _train_nlu_with_validated_data
    await rasa.nlu.train.train(
  File "C:\Python39\lib\site-packages\rasa\nlu\train.py", line 96, in train
    trainer = Trainer(
  File "C:\Python39\lib\site-packages\rasa\nlu\model.py", line 164, in __init__
    components.validate_requirements(cfg.component_names)
  File "C:\Python39\lib\site-packages\rasa\nlu\components.py", line 58, in validate_requirements
    from rasa.nlu import registry
  File "C:\Python39\lib\site-packages\rasa\nlu\registry.py", line 12, in <module>
    from rasa.nlu.classifiers.diet_classifier import DIETClassifier
  File "C:\Python39\lib\site-packages\rasa\nlu\classifiers\diet_classifier.py", line 24, in <module>
    from rasa.utils.tensorflow.models import RasaModel, TransformerRasaModel
  File "C:\Python39\lib\site-packages\rasa\utils\tensorflow\models.py", line 47, in <module>
    from rasa.utils.tensorflow.temp_keras_modules import TmpKerasModel
  File "C:\Python39\lib\site-packages\rasa\utils\tensorflow\temp_keras_modules.py", line 16, in <module>
    from keras.callbacks import Callback, History
ModuleNotFoundError: No module named 'keras'

I donot know why its coming because keras is successfully installed in my system and also running. Please do help me as soon as possible I shall be highly thankful to you.

@Akshat_Vashisht Confirm me, is that you installed the rasa open source directly on the base anaconda or did you created the python environment ?

I have created the virtual environment for installing rasa but at last of installing it was giving me warnings in yellow color

@Akshat_Vashisht please try update the TensorFlow in the conda environment.

ss2 Getting again the same error

C:\Users\om sai infotech\OneDrive\Desktop\bot>rasa init Welcome to Rasa! :robot:

To get started quickly, an initial project will be created. If you need some help, check out the documentation at Introduction to Rasa Open Source. Now let’s start! :point_down:t4:

? Please enter a path where the project will be created [default: current directory] . ? Directory ‘C:\Users\om sai infotech\OneDrive\Desktop\bot’ is not empty. Continue? Yes Created project directory at ‘C:\Users\om sai infotech\OneDrive\Desktop\bot’. Finished creating project structure. ? Do you want to train an initial model? :muscle:t4: Yes Training an initial model… Traceback (most recent call last): File “c:\python39\lib\runpy.py”, line 194, in _run_module_as_main return run_code(code, main_globals, None, File “c:\python39\lib\runpy.py”, line 87, in run_code exec(code, run_globals) File "C:\Python39\Scripts\rasa.exe_main.py", line 7, in File "c:\python39\lib\site-packages\rasa_main.py", line 118, in main cmdline_arguments.func(cmdline_arguments) File “c:\python39\lib\site-packages\rasa\cli\scaffold.py”, line 235, in run init_project(args, path) File “c:\python39\lib\site-packages\rasa\cli\scaffold.py”, line 130, in init_project print_train_or_instructions(args, path) File “c:\python39\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:\python39\lib\site-packages\rasa\api.py”, line 106, in train from rasa.model_training import train_async File “c:\python39\lib\site-packages\rasa\model_training.py”, line 22, in from rasa.nlu.model import Interpreter File “c:\python39\lib\site-packages\rasa\nlu\model.py”, line 14, in from rasa.nlu import components, utils File “c:\python39\lib\site-packages\rasa\nlu\components.py”, line 7, in import rasa.utils.train_utils File “c:\python39\lib\site-packages\rasa\utils\train_utils.py”, line 39, in from rasa.utils.tensorflow.callback import RasaTrainingLogger, RasaModelCheckpoint File “c:\python39\lib\site-packages\rasa\utils\tensorflow\callback.py”, line 13, in class RasaTrainingLogger(tf.keras.callbacks.Callback): File “c:\python39\lib\site-packages\tensorflow\python\util\lazy_loader.py”, line 62, in getattr module = self._load() File “c:\python39\lib\site-packages\tensorflow\python\util\lazy_loader.py”, line 45, in load module = importlib.import_module(self.name) File "c:\python39\lib\importlib_init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named ‘keras’

Please tell me how to resolve this

@Akshat_Vashisht You need to share me some screenshot, not the error like this and me confused; are you creating python 3.6, 3.7 and 3.8 environment and what about anaconda version, hope you following this process; Installing on Windows — Anaconda documentation