AttributeError: module 'rasa_core.channels' has no attribute 'channel'

I am trying to deploy a chatbot using the SocketIO channel and this answer - Connect rasa to a web site with the recommeded plataform

I am getting the error

AttributeError: module 'rasa_core.channels' has no attribute 'channel'

when I try to run this file -

from rasa_core.channels.socketio import SocketIOInput
from rasa_core.agent import Agent
from rasa_core.interpreter import NaturalLanguageInterpreter

# load your trained agent
interpreter = NaturalLanguageInterpreter.create('C:/Users/NJJainnew_ex/models/20190805-123059/nlu')
agent = Agent.load('C:/Users/NJJain/new_ex/models/20190805-123059', interpreter=interpreter)

input_channel = SocketIOInput(
            # event name for messages sent from the user
            user_message_evt="user_uttered",
            # event name for messages sent from the bot
            bot_message_evt="bot_uttered",
            # socket.io namespace to use for the messages
            namespace=None
    )

# set serve_forever=False if you want to keep the server running
s = agent.handle_channels([input_channel], 5005)

I have tried implementing this before and it worked then, don’t know the issue now. My credentials.yml file is -

socketio:
  user_message_evt: user_uttered
  bot_message_evt: bot_uttered
  session_persistence: false

and my endpoints.yml file is -

action_endpoint:
  url: "http://localhost:5055/webhook"

This is what I added to the tag of my webpage -

<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-0.5.8.js"></script>
<script>
  WebChat.default.init({
    selector: "#webchat",
    initPayload: "/get_started",
    interval: 1000, // 1000 ms between each message
    customData: {"userId": "123"}, // arbitrary custom data. Stay minimal as this will be added to the socket
    socketUrl: "http://localhost:5005",
    socketPath: "/socket.io/",
    title: "Title",
    subtitle: "Subtitle",
    inputTextFieldHint: "Type a message...",
    connectingText: "Waiting for server...",
    hideWhenNotConnected: true,
    fullScreenMode: false,
    profileAvatar: "http://to.avat.ar",
    openLauncherImage: 'myCustomOpenImage.png',
    closeLauncherImage: 'myCustomCloseImage.png',
    params: {
      images: {
        dims: {
          width: 300,
          height: 200,
        }
      },
      storage: "session"
    }
  })
</script>

as detailed by the webchat github.The full error -

Traceback (most recent call last):
  File "connect.py", line 19, in <module>
    s = agent.handle_channels([input_channel], 5005)
  File "C:\Users\NJJain\AppData\Local\Continuum\anaconda3\envs\rasa\lib\site-packages\rasa\core\agent.py", line 679, in handle_channels
    app = run.configure_app(channels, cors, None, enable_api=False, route=route)
  File "C:\Users\NJJain\AppData\Local\Continuum\anaconda3\envs\rasa\lib\site-packages\rasa\core\run.py", line 91, in configure_app
    rasa.core.channels.channel.register(input_channels, app, route=route)
AttributeError: module 'rasa_core.channels' has no attribute 'channel'

I changed

from rasa_core.channels.socketio import SocketIOInput

to

from rasa.core.channels.socketio import SocketIOInput

and updated all mentions of rasa_core with rasa.core, and did not get the error. But even though I can see the widget on the webpage, whatever I type, it only replies with:

fallback

This is what I’m getting after executing the first python file -

unknown

I have the ngrok server running on port 5005 as well.

can you try setting the environment variable LOG_LEVEL="DEBUG" to see if you get some more helpful output?

do we have to change something in our js file to deploy our bot to website or just including this codes will work