ChatterBot
ChatterBot copied to clipboard
error for AttributeError: module 'time' has no attribute 'clock' in chatterbot
C:\Users\User\Downloads\TSC>main.py
Traceback (most recent call last):
File "C:\Users\User\Downloads\TSC\main.py", line 8, in <module>
chatbot = ChatBot("Ninja")
File "C:\Python39\lib\site-packages\chatterbot\chatterbot.py", line 41, in __init__
self.storage = utils.initialize_class(storage_adapter, **kwargs)
File "C:\Python39\lib\site-packages\chatterbot\utils.py", line 54, in initialize_class
return Class(*args, **kwargs)
File "C:\Python39\lib\site-packages\chatterbot\storage\sql_storage.py", line 22, in __init__
from sqlalchemy import create_engine
File "C:\Python39\lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
from . import util as _util # noqa
File "C:\Python39\lib\site-packages\sqlalchemy\util\__init__.py", line 14, in <module>
from ._collections import coerce_generator_arg # noqa
File "C:\Python39\lib\site-packages\sqlalchemy\util\_collections.py", line 16, in <module>
from .compat import binary_types
File "C:\Python39\lib\site-packages\sqlalchemy\util\compat.py", line 264, in <module>
time_func = time.clock
AttributeError: module 'time' has no attribute 'clock'
Hey! I think that the clock() function does not exist anymore in the time module, that is the issue here...
A quick fix that I did is I went to the file "C:\Python39\lib\site-packages\sqlalchemy\util\compat.py"
, scrolled down all the way to line 264, and just removed that whole line... worked well enough for me, and I hope it does for you too! 😀
just wondering, can it be that this thing installs an old version of sqlalchemy some how? I mean that thing is still pretty actively maintained and i doupt a bit they would leave a function that is 2 years deprecated in there.
just wondering, can it be that this thing installs an old version of sqlalchemy some how? I mean that thing is still pretty actively maintained and i doupt a bit they would leave a function that is 2 years deprecated in there.
Yeah that's definitely it, this is the requirements.txt.
mathparse>=0.1,<0.2
python-dateutil>=2.8,<2.9
sqlalchemy>=1.3,<1.4
pytz
Hey! I think that the clock() function does not exist anymore in the time module, that is the issue here... A quick fix that I did is I went to the file
"C:\Python39\lib\site-packages\sqlalchemy\util\compat.py"
, scrolled down all the way to line 264, and just removed that whole line... worked well enough for me, and I hope it does for you too! 😀
Eu arrumei isso colocando "time.time" ao inves de "time.clock" e funcinou mt bem :)
Hey! I think that the clock() function does not exist anymore in the time module, that is the issue here... A quick fix that I did is I went to the file
"C:\Python39\lib\site-packages\sqlalchemy\util\compat.py"
, scrolled down all the way to line 264, and just removed that whole line... worked well enough for me, and I hope it does for you too! 😀Eu arrumei isso colocando "time.time" ao inves de "time.clock" e funcinou mt bem :)
ohh that's rly cool then, didn't quite realise I could do that lol 😅