AttributeError module 'time' has no attribute 'clock'
Using PyQtGraph with Python 3.8

PyQtGraph is a library for creating plots in PyQt applications. Recent changes in Python 3.8 can cause problems if you're using older versions of PyQtGraph.

I got an error when running your plotting script above at line from pyqtgraph import PlotWidget, plot, which gave the error Exception has occurred: AttributeError module 'time' has no attribute 'clock'

The clock member was removed from the time module in Python 3.8. In your own code this can be replaced with either time.perf_counter() or time.process_time() instead, depending on your requirements. For libraries such as PyQtGraph you'll need to wait for them to be updated.

This was fixed in PyQtGraph v0.11.0rc0 and is available via PyPi.

In future, if you need to access the latest versions of PyQtGraph before release, you can also install the current master from Github directly.

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

Alternatively, you can downgrade to Python 3.7 in the meantime.

Continue reading

Plotting with PyQtGraph  pyside

One of the major strengths of Python is in exploratory data science and visualization, using tools such as Pandas, numpy, sklearn for data analysis and matplotlib plotting. Buiding GUI applications with PySide gives you access to all these Python tools directly from within your app, allowing you to build complex … More