AttributeError: module ‘time’ has no attribute ‘clock’
Error Messages:
# `flask_sqlalchemy` Error:
File "D:\python38-flasky\lib\site-packages\sqlalchemy\util\compat.py", line 172, in <module>
time_func = time.clock
AttributeError: module 'time' has no attribute 'clock'
reason:
Python 3.8 no longer supports time.clock, but it still contains this method when calling. There is a version problem.
Solution:
Use the replacement method: time.perf_Counter()
, such as:
import time
if win32 or jython:
# time_func = time.clock
time_finc = time.perf_counter()
else:
time_func = time.time
Read More:
- Python3.7 AttributeError: module ‘time‘ has no attribute ‘clock‘
- [Solved] AttributeError: module ‘time‘ has no attribute ‘clock‘
- [Solved] Paramiko error: AttributeError: ‘NoneType’ object has no attribute ‘time’
- AttributeError: module ‘enum‘ has no attribute ‘IntFlag‘ [How to Solve]
- [Solved] AttributeError: module ‘logging‘ has no attribute ‘Handler‘
- [How to Solve]AttributeError: module ‘scipy’ has no attribute ‘io’
- [Solved] AttributeError: module ‘PIL.Image‘ has no attribute ‘open‘
- Python AttributeError: module ‘tensorflow‘ has no attribute ‘InteractiveSession‘
- [Solved]AttributeError: module ‘urllib’ has no attribute ‘quote’
- [Solved] AttributeError: module ‘distutils‘ has no attribute ‘version‘
- [Solved] AttributeError: module ‘selenium.webdriver‘ has no attribute ‘Chrome‘
- [Solved] AttributeError: module ‘setuptools._distutils‘ has no attribute ‘version‘
- [Solved] AttributeError: partially initialized module ‘xlwings’ has no attribute ‘App’
- [Solved] AttributeError: module ‘tensorflow‘ has no attribute ‘distributions‘
- [Solved] AttributeError: module ‘pandas‘ has no attribute ‘rolling_count‘
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- [Solved] AttributeError: module ‘dlib‘ has no attribute ‘get_face_chip‘
- BlazingSQL Error: AttributeError: module ‘cio‘ has no attribute ‘RunQueryError‘
- [Solved] Error: AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
- [Solved] Python Error: AttributeError: partially initialized module ‘keyword‘ has no attribute ‘kwlist‘