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

Embedding custom widgets from Qt Designer  pyside

Qt Designer is a great tool for designing PySide6 GUIs, allowing you to use the entire range of Qt5 widgets and layouts to construct your apps. As your applications get more complex however you may find yourself creating custom widgets, or using PySide6 libraries such as PyQtGraph, who's widgets are not available within Designer. More