Cannot import QtWebKitWidgets in PyQt5

后端 未结 5 723
盖世英雄少女心
盖世英雄少女心 2020-11-27 05:42

I\'ve recently upgraded PyQt5 from 5.5.1 to 5.6.0 using the Windows 32-bit installer here: https://www.riverbankcomputing.com/software/pyqt/download5. I\'ve also upgraded my

相关标签:
5条回答
  • 2020-11-27 06:05

    If you really want to use PyQt5.QtWebKitWidgets, you could run this from the command line:

    pip install PyQtWebKit
    

    and let it do what it does.

    0 讨论(0)
  • 2020-11-27 06:06

    I was trying to run qutebrowser and it had the same error, the answer is simple, the packages changed. You have two solutions:

    1)

    pip install PyQtWebEngine
    

    2)

    pip install PyQt5==5.11.3
    

    Hope this helps any future problems

    0 讨论(0)
  • 2020-11-27 06:14

    In PyQt5 "QtWebKitWidgets" is Deprecated. I just replace this line

    from PyQt5.QtWebKitWidgets import QWebView, QWebPage
    from PyQt5.QtWebKit import QWebSettings
    

    With this code:

    from PyQt5.QtWebEngineWidgets import QWebEngineView as QWebView,QWebEnginePage as QWebPage
    from PyQt5.QtWebEngineWidgets import QWebEngineSettings as QWebSettings
    
    0 讨论(0)
  • 2020-11-27 06:16

    QtWebKit got deprecated upstream in Qt 5.5 and removed in 5.6.

    You may want to switch to PyQt5.QtWebEngineWidgets :

    This supercedes the QtWebKit module and provides better and up-to-date support for HTML, CSS and JavaScript features

    0 讨论(0)
  • 2020-11-27 06:20

    In PyQt5 "QtWebKitWidgets" is no longer available. Instead it is replaced with "QtWebEngineWidgets". So you have to make this change in your code.

    For more information: http://doc.qt.io/qt-5/qtwebenginewidgets-qtwebkitportingguide.html

    0 讨论(0)
提交回复
热议问题