[PyQt] Errors about QWebEngineView
Phil Thompson
phil at riverbankcomputing.com
Wed Jul 27 09:32:16 BST 2016
On 27 Jul 2016, at 7:18 am, Yu-wen Pwu <ywpu at cs.nctu.edu.tw> wrote:
>
> Hi,
>
> I'm writing a program containing a QWebEngineView:
>
> import sys
> from PyQt5.QtWidgets import QApplication
> from PyQt5.QtWidgets import QMainWindow
> from PyQt5.QtWebEngineWidgets import QWebEngineView
> from PyQt5.QtCore import QUrl
> def main():
> app = QApplication(sys.argv)
> window = QMainWindow()
> window.setWindowTitle('PyQt Demo')
> window.setGeometry(320, 180, 960, 540)
> view = QWebEngineView()
> view.load(QUrl('http://leafletjs.com/'))
> window.setCentralWidget(view)
> window.show()
> sys.exit(app.exec_())
> if __name__ == '__main__':
> main()
>
> But I get error messages telling me some files are missing. Finally, I find that by copying everything under /usr/local/lib/python3.5/dist-packages/PyQt5/Qt/resources/ to /usr/local/lib/python3.5/dist-packages/PyQt5/Qt/libexec/ and /usr/local/lib/python3.5/dist-packages/PyQt5/Qt/libexec/qtwebengine_locales/, the program works. (Though it still output some warnings.)
>
> See also: https://gist.github.com/yuwen41200/b57f66b898f23c034afb796e842dbdf6
>
> I'm using PyQt5==5.6. Is it a bug in PyQt or other problems in my system?
Try PyQt v5.7.
Phil
More information about the PyQt
mailing list