module 'time' has no attribute 'clock'

2,807 views
Skip to first unread message

Charles Nystrom

unread,
Feb 29, 2020, 12:05:33 PM2/29/20
to pyqtgraph
With Python 3.8.2 time.clock() has been depreciated. I keep getting the error: AttributeError: module 'time' has no attribute 'clock'
Is this going to be fixed or do I need to go back to an older version?

Jim Crowell

unread,
Feb 29, 2020, 9:09:04 PM2/29/20
to pyqtgraph
It looks like it's only used in pyqtgraph.ptime, and then only on Windows. There are some shenanigans there that I don't understand. For a quick fix, you might try replacing the two calls to clock() in that file with perf_counter(), but I don't really understand what's being done there.

Kenneth Lyons

unread,
Mar 1, 2020, 9:00:26 PM3/1/20
to pyqtgraph
This has been fixed but not released fully yet (see https://github.com/pyqtgraph/pyqtgraph/issues/925)

A release candidate is available (0.11.0rc0) and it shouldn't have this issue. You can install it with:

pip install --pre pyqtgraph
Reply all
Reply to author
Forward
0 new messages