0

I am trying to use plotly with pyqt5. I found an example code here: How to have plotly graph as PyQt5 widget? The code is the following:

from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets
import plotly.express as px


class Widget(QtWidgets.QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.button = QtWidgets.QPushButton('Plot', self)
        self.browser = QtWebEngineWidgets.QWebEngineView(self)

        vlayout = QtWidgets.QVBoxLayout(self)
        vlayout.addWidget(self.button, alignment=QtCore.Qt.AlignHCenter)
        vlayout.addWidget(self.browser)

        self.button.clicked.connect(self.show_graph)
        self.resize(1000,800)

    def show_graph(self):
        df = px.data.tips()
        fig = px.box(df, x="day", y="total_bill", color="smoker")
        fig.update_traces(quartilemethod="exclusive") # or "inclusive", or "linear" by default
        self.browser.setHtml(fig.to_html(include_plotlyjs='cdn'))

if __name__ == "__main__":
    app = QtWidgets.QApplication([])
    widget = Widget()
    widget.show()
    app.exec()

When I try to run it, I get the following error messege:

[18152:16788:0924/110112.767:ERROR:dxva_video_decode_accelerator_win.cc(1399)] DXVAVDA fatal error: could not LoadLibrary: mf.dll: The specified module could not be found. (0x7E)
[18152:16788:0924/110112.770:ERROR:dxva_video_decode_accelerator_win.cc(1399)] DXVAVDA fatal error: could not LoadLibrary: mfplat.dll: The specified module could not be found. (0x7E)
[18152:16788:0924/110112.771:ERROR:dxva_video_decode_accelerator_win.cc(1399)] DXVAVDA fatal error: could not LoadLibrary: msmpeg2vdec.dll: The specified module could not be found. (0x7E)
[18152:16788:0924/110112.773:ERROR:dxva_video_decode_accelerator_win.cc(1407)] DXVAVDA fatal error: could not LoadLibrary: msvproc.dll: The specified module could not be found. (0x7E)

What could I do?

4
  • Do you have an “N” version of Windows? Commented Sep 24, 2021 at 9:47
  • Yes, Windows 10 Education N. Commented Sep 24, 2021 at 10:37
  • You need to download "Windows Media Feature Pack": microsoft.com/en-us/software-download/mediafeaturepack Commented Sep 24, 2021 at 10:40
  • Thanks for the help, it did not work, but I found an other way. Commented Sep 24, 2021 at 11:42

1 Answer 1

1

I tried to install the windows media feature pack as @tromgy suggested, but apparently "These changes are not applicable" to my PC, so I downloaded the dll-s one by one from https://www.dll-files.com/ and pasted them to C:\Windows\System32, and now the code works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.