Attribute ‘clock’ is missing in the ‘time’ module of pandas while using Sqlite3

One possible solution is to remove a certain file from the folder where the error is occurring and then run the program again, which worked for someone experiencing the same issue. However, while handling the exception, another one occurred, suggesting that at the very least, the package should be updated. Another approach is to update a specific element, which someone had to do to resolve a similar issue, although they still faced problems even after doing so.


My objective is to convert my database into


suitable for pandas dataframe.

I’m using this piece of code:

con = sqlite3.connect('pathdb.db')
df = pd.read_sql('select * from db', con)

Trackback what I got:

Traceback (most recent call last):
    df = pd.read_sql('select * from db', con)
  File "", line 403, in read_sql
    pandas_sql = pandasSQL_builder(con)
  File "", line 578, in pandasSQL_builder
    if _is_sqlalchemy_connectable(con):
  File "", line 43, in _is_sqlalchemy_connectable
    import sqlalchemy
  File "", line 12, in 
    from sqlalchemy.sql import (
  File "", line 7, in 
    from sqlalchemy.sql.expression import (
  File "", line 32, in 
    from sqlalchemy import util, exc
  File "", line 7, in 
    from .compat import callable, cmp, reduce, defaultdict, py25_dict, 
  File "", line 202, in 
    time_func = time.clock
AttributeError: module 'time' has no attribute 'clock'

Is this code malfunctioning? What is causing the error?


The version of SQLAlchemy that is being referred to, 0.7.10, is quite outdated. In fact, it was released over six years ago and utilized the



The usage of time.clock in Python 3.3 is deprecated and will be eliminated from Python 3.8. Instead, time.perf_counter or time.process_time should be used. A DeprecationWarning will be raised if time.clock is still used.

Frequently Asked Questions