我最近尝试制作一个 PyQt5 Web 浏览器。在我使用虚拟环境运行代码之前,它一直显示错误。现在我想在没有虚拟环境的情况下运行代码,但它只显示此错误:
Traceback (most recent call last):
File "Browser.py", line 2, in <module>
from PyQt5.QtCore import *
ImportError: DLL load failed while importing QtCore: The specified module could not be found.
我的代码如下所示:
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_())
如您所知,我使用的是 Windows 10(64 位)和 Python 3.8.5。