我最近听说了PyQt4,并决定我应该试一试,然而,导入给了我一些错误。当我尝试导入QtCore和QtGui时,收到以下错误:
from PyQt4 import QtCore, QtGui
ImportError: DLL load failed: The specified module could not be found.我在我的Windows32位计算机上使用Python3.6.0,我通过使用以下命令安装了pyqt4
pip install pyqt4-4.11.4-cp36-cp36m-win32.whl为了解决这个问题,我查看了我的站点包,我确实看到了
发布于 2020-10-18 06:52:01
您应该使用PyQt5。我知道它没有QWebView,但它有一个额外的模块叫做QWebEngineView.您可以通过在终端中运行以下命令来安装它:pip install PyQtWebEngine。这是我使用的代码:
import sys
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtWidgets import QApplication
url = "https://stackoverflow.com/"
app = QApplication(sys.argv)
web = QWebEngineView()
web.load(QUrl(url))
web.setZoomFactor(2)
web.zoomFactor()
web.show()
sys.exit(app.exec_())https://stackoverflow.com/questions/43021518
复制相似问题