PyQtGraph error module 'time' has no attribute 'clock'

Heads up! You've already completed this tutorial.

Bob_M | 2020-05-09 13:48:20 UTC | #1

I got an error when running your plotting script above at line from pyqtgraph import PlotWidget, plot, an error below occurs:

python
Exception has occurred: AttributeError
module 'time' has no attribute 'clock'
File "C:\Dev\VsCodePython_ *main_* .py", line 16, in <module>
from pyqtgraph import PlotWidget, plot

C:\Dev\VsCodePython_ *main_* .py is my script file with the plotting code. The pyqtgraph is in my installed list.


martin | 2020-05-11 11:29:40 UTC | #2

Hey @Bob_M --- this is an issue between your version of PyQtGraph and Python 3.8. The clock member was removed from time in Python 3.8.

It's fixed in the next release candidate of PyQtGraph so you can either install the developer version from github using

python
pip install git+https://github.com/pyqtgraph/pyqtgraph.git

wait for the final release, or downgrade to Python 3.7 in the meantime.

Over 10,000 developers have bought Create GUI Applications with Python & Qt!
Create GUI Applications with Python & Qt5
Take a look

Downloadable ebook (PDF, ePub) & Complete Source code

Also available from Leanpub and Amazon Paperback

[[ discount.discount_pc ]]% OFF for the next [[ discount.duration ]] [[discount.description ]] with the code [[ discount.coupon_code ]]

Purchasing Power Parity

Developers in [[ country ]] get [[ discount.discount_pc ]]% OFF on all books & courses with code [[ discount.coupon_code ]]


Packaging Python Applications with PyInstaller by Martin Fitzpatrick — This step-by-step guide walks you through packaging your own Python applications from simple examples to complete installers and signed executables.

More info Get the book

Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak

PyQtGraph error module 'time' has no attribute 'clock' was written by Martin Fitzpatrick .

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt.