0

I am learning and building a chatterbot with Python. I start with writing a simple chattbox. When I run the code, it errors out.

I am using Python 3.8.5, chatterbot 1.0.4 and Atom IDE

from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer

chatbot = ChatBot('Javis')

trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train("chatterbot.corpus.english")
response = chatbot.get_response("Hello, how are you today?")
print(response)

When I run the code on Atom platformio-ide-terminal, it throws an error

Traceback (most recent call last):
  File "chatbot.py", line 4, in <module>
    chatbot = ChatBot('Bon')
  File "C:\Python\Python38-32\lib\site-packages\chatterbot\chatterbot.py", line 34, in __init__
    self.storage = utils.initialize_class(storage_adapter, **kwargs)
  File "C:\Python\Python38-32\lib\site-packages\chatterbot\utils.py", line 54, in initialize_class
    return Class(*args, **kwargs)
  File "C:\Python\Python38-32\lib\site-packages\chatterbot\storage\sql_storage.py", line 22, in __init__
    from sqlalchemy import create_engine
  File "C:\Python\Python38-32\lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
    from . import util as _util  # noqa

  File "C:\Python\Python38-32\lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
    from ._collections import coerce_generator_arg  # noqa
  File "C:\Python\Python38-32\lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
    from .compat import binary_types
  File "C:\Python\Python38-32\lib\site-packages\sqlalchemy\util\compat.py", line 264, in <module>
    time_func = time.clock
AttributeError: module 'time' has no attribute 'clock'
BAST23
  • 75
  • 5

1 Answers1

0

The function time.clock is deprecated since 3.3 version of python. Please check here for reference AttributeError: module 'time' has no attribute 'clock' in Python 3.8 , might be useful.

Shreyash Sharma
  • 180
  • 2
  • 14