Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'time' has no attribute 'clock' In SQLAlchemy python 3.8.2

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Anirudh\Documents\flask_app\connecting_to_database\application.py", line 2, in <module>
    from flask_sqlalchemy import SQLAlchemy
  File "C:\Users\Anirudh\AppData\Local\Programs\Python\Python38\lib\site-packages\flask_sqlalchemy\__init__.py", line 18, in <module>
    import sqlalchemy
  File "C:\Users\Anirudh\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\__init__.py", line 9, in <module>
    from .sql import (
  File "C:\Users\Anirudh\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\sql\__init__.py", line 8, in <module>
    from .expression import (
  File "C:\Users\Anirudh\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\sql\expression.py", line 34, in <module>
    from .visitors import Visitable
  File "C:\Users\Anirudh\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\sql\visitors.py", line 28, in <module>
    from .. import util
  File "C:\Users\Anirudh\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\util\__init__.py", line 8, in <module>
    from .compat import callable, cmp, reduce,  \
  File "C:\Users\Anirudh\AppData\Local\Programs\Python\Python38\lib\site-packages\sqlalchemy\util\compat.py", line 234, in <module>
    time_func = time.clock
AttributeError: module 'time' has no attribute 'clock'
like image 516
Anirudh Singh Chauhan Avatar asked Jun 17 '20 19:06

Anirudh Singh Chauhan


1 Answers

I had this issue with SQLAlchemy 1.2.10. Upgrading to the current version (1.3.18 as of now) fixed the problem

pip install sqlalchemy --upgrade
like image 115
EffinAndJeffin Avatar answered Oct 19 '22 10:10

EffinAndJeffin