PyQt5 not displaying plots

I’m using a combination of pyqt5 and plotly to actually display graphs in my application, and until very recently this has worked great. I’ve been loading plotly graphs in as web pages via QWebEngineViews.

After an update on my main development machine, graphs just don’t show up in PyQt5 widgets. On literally every system I have this issue is occurring, the entire list of operating systems I’m able to reproduce this on includes Manjaro, Arch, Ubuntu 18.04 LTS, and Windows 10. The only system of mine this issue isn’t occurring on is a machine that’s a few weeks out of date.

To give an example, this program just displays a blank window, but if you open the plot it produces in a browser that displays fine.

#!/usr/bin/python3
import sys
import plotly
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEngineView


def main():
    '''
        A simple example of a plotly application
    '''
    # Some data
    x_coords = [1, 2, 3, 5, 6]
    y_coords = [1, 4.5, 7, 24, 38]

    trace = dict(x=x_coords, y=y_coords)

    data = [trace]

    app = QApplication(sys.argv)
    view = QWebEngineView()
    view.load(QUrl(plotly.offline.plot(data, auto_open=False)))
    view.show()
    return app.exec_()


if __name__ == "__main__":
    main()

So I’ve tried downgrading libraries, except downgrading ploty, a number of Qt libraries, or even both didn’t resolve the issue. At this point, I’m not really sure what’s wrong, and I’m hoping someone knows how to make plots display in Qt again.

three reasons why you should buy plotly pro: support open source, get great support, host your plots and dashboards online