AttributeError: module 'time' has no attribute 'clock'
See original GitHub issueCode Source:
`from chatterbot import ChatBot chatbot = ChatBot( ‘EjemploBot’, trainer=‘chatterbot.trainers.ChatterBotCorpusTrainer’ )
chatbot.train(“chatterbot.corpus.spanish”)
while True: usuario = input(">>> ") respuesta = chatbot.get_response(usuario) print ("bot: "+str(respuesta))
`
ERROR:
C:\00-Documentos\01-Proyectos\01-Proyectos Python\01-Chatbot>python pract_chatterbox_v2.py Traceback (most recent call last): File “pract_chatterbox_v2.py”, line 5, in <module> chatbot = ChatBot( File “C:\Python38-64\lib\site-packages\chatterbot\chatterbot.py”, line 35, in init self.storage = utils.initialize_class(storage_adapter, **kwargs) File “C:\Python38-64\lib\site-packages\chatterbot\utils.py”, line 54, in initialize_class return Class(*args, **kwargs) File “C:\Python38-64\lib\site-packages\chatterbot\storage\sql_storage.py”, line 22, in init from sqlalchemy import create_engine File “C:\Python38-64\lib\site-packages\sqlalchemy_init_.py”, line 8, in <module> from . import util as util # noqa File "C:\Python38-64\lib\site-packages\sqlalchemy\util_init.py", line 14, in <module> from ._collections import coerce_generator_arg # noqa File “C:\Python38-64\lib\site-packages\sqlalchemy\util_collections.py”, line 16, in <module> from .compat import binary_types File “C:\Python38-64\lib\site-packages\sqlalchemy\util\compat.py”, line 264, in <module> time_func = time.clock AttributeError: module ‘time’ has no attribute ‘clock’
``
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:14 (3 by maintainers)
Top GitHub Comments
I’m also facing the same problem and hope to see updates soon but think the solution: if win32 or jython: try: # Python 3.4+ preferred_clock = time.perf_counter except AttributeError: # Earlier than Python 3. preferred_clock = time.clock else: time_func = time.time
is working properly!!
Thank you very much