Search code examples
djangopython-3.xchatterbot

Module object has no attribute SQLStorageAdapter


While running django chatterbot app, i encounter an error

  module' object has no attribute 'SQLStorageAdapter'

I define chatbot the following way in my view.

       chatbot = ChatBot(
        "SQLMemoryTerminal",
        storage_adapter='chatterbot.storage.SQLStorageAdapter',
        logic_adapters=[
            "chatterbot.logic.MathematicalEvaluation",
            "chatterbot.logic.TimeLogicAdapter",
            "chatterbot.logic.BestMatch"
        ],

        input_adapter="chatterbot.input.TerminalAdapter",
        output_adapter="chatterbot.output.TerminalAdapter",
    )

Can anybody tell me why I am getting this error? Should I need any extra library or something like that? Thanks.


Solution

  • I think you were using very old version of chatterbot, you could try to upgrade to latest version by using.

    pip install --upgrade chatterbot
    

    Instead SQLStorageAdapter I recommended to use Mongo-DB as your storage adapter.

    For more information fallow this link http://chatterbot.readthedocs.io/en/stable/storage/index.html#mongodb-storage-adapter