警告:找不到库:Qt5WebKitd.dll、Qt5Cored.dll pyinstaller
Posted
技术标签:
【中文标题】警告:找不到库:Qt5WebKitd.dll、Qt5Cored.dll pyinstaller【英文标题】:WARNING: lib not found: Qt5WebKitd.dll, Qt5Cored.dll pyinstaller 【发布时间】:2020-06-20 08:14:04 【问题描述】:我正在将 python 脚本编译为 .exe。但输出返回某种缺失的库。我尝试使用 --path 将路径更改为 python qt/bin 但同样的错误。我尝试了基于控制台的、窗口化的、onefile 甚至 pyinstaller 中的所有内容。但同样的问题。当我使用 python 运行脚本时,它可以正常工作。
使用 Python 运行 Python 脚本时的屏幕截图
我从编译后的 .exe 运行时的屏幕截图
import sys
from PyQt5.QtWidgets import QMainWindow,QApplication,QLineEdit,QPushButton,QTabWidget,QVBoxLayout,QWidget
from PyQt5.QtWebKitWidgets import *
app=QApplication(sys.argv)
tabs=QTabWidget()
tabs.resize(400,300)
mainWindow=QMainWindow()
widget=QWidget()
mainWindow=QMainWindow()
mainWindow.setWindowTitle("Sprotechs")
web=QWebView()
web.load(QUrl("https://google.com"))
verticalLayout=QVBoxLayout()
verticalLayout.addWidget(web)
widget.setLayout(verticalLayout)
mainWindow.setCentralWidget(widget)
mainWindow.show()
sys.exit(app.exec_())
错误输出
21734 INFO: Looking for dynamic libraries 23408 WARNING: lib not found: Qt53DLogic.dll dependency of C:\users\shop 129 c\a ppdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit \qtquickscene3dplugin.dll 23445 WARNING: lib not found: Qt53DInput.dll dependency of C:\users\shop 129 c\a ppdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit \qtquickscene3dplugin.dll 23491 WARNING: lib not found: Qt53DRender.dll dependency of C:\users\shop 129 c\ appdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKi t\qtquickscene3dplugin.dll 23520 WARNING: lib not found: Qt53DCore.dll dependency of C:\users\shop 129 c\ap pdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit\ qtquickscene3dplugin.dll 27549 WARNING: lib not found: Qt53DQuickScene2D.dll dependency of C:\users\shop 129 c\appdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\Q tQuick\Scene2D\qtquickscene2dplugin.dll 27608 WARNING: lib not found: Qt53DRender.dll dependency of C:\users\shop 129 c\ appdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick \Scene2D\qtquickscene2dplugin.dll 27653 WARNING: lib not found: Qt53DCore.dll dependency of C:\users\shop 129 c\ap pdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\S cene2D\qtquickscene2dplugin.dll 29883 WARNING: lib not found: Qt5Qmld.dll dependency of C:\users\shop 129 c\appd ata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit\ex perimental\qmlwebkitexperimentalplugind.dll 29914 WARNING: lib not found: Qt5Cored.dll dependency of C:\users\shop 129 c\app data\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit\e xperimental\qmlwebkitexperimentalplugind.dll 29948 WARNING: lib not found: Qt5WebKitd.dll dependency of C:\users\shop 129 c\a ppdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit \experimental\qmlwebkitexperimentalplugind.dll 29980 WARNING: lib not found: ucrtbased.dll dependency of C:\users\shop 129 c\ap pdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit\ experimental\qmlwebkitexperimentalplugind.dll 30010 WARNING: lib not found: VCRUNTIME140D.dll dependency of C:\users\shop 129 c\appdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWeb Kit\experimental\qmlwebkitexperimentalplugind.dll 30041 WARNING: lib not found: Qt5Quickd.dll dependency of C:\users\shop 129 c\ap pdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit\ experimental\qmlwebkitexperimentalplugind.dll 30320 WARNING: lib not found: Qt5Qmld.dll dependency of C:\users\shop 129 c\appd ata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit\qm lwebkitplugind.dll 30347 WARNING: lib not found: Qt5Cored.dll dependency of C:\users\shop 129 c\app data\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit\q mlwebkitplugind.dll 30378 WARNING: lib not found: Qt5WebKitd.dll dependency of C:\users\shop 129 c\a ppdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit \qmlwebkitplugind.dll 30407 WARNING: lib not found: Qt5Networkd.dll dependency of C:\users\shop 129 c\ appdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKi t\qmlwebkitplugind.dll 30435 WARNING: lib not found: ucrtbased.dll dependency of C:\users\shop 129 c\ap pdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit\ qmlwebkitplugind.dll 30463 WARNING: lib not found: VCRUNTIME140D.dll dependency of C:\users\shop 129 c\appdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWeb Kit\qmlwebkitplugind.dll 30490 WARNING: lib not found: Qt5Quickd.dll dependency of C:\users\shop 129 c\ap pdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtWebKit\ qmlwebkitplugind.dll 30707 WARNING: lib not found: Qt53DLogic.dll dependency of C:\users\shop 129 c\a ppdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\ Scene3D\qtquickscene3dplugin.dll 30744 WARNING: lib not found: Qt53DInput.dll dependency of C:\users\shop 129 c\a ppdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\ Scene3D\qtquickscene3dplugin.dll 30783 WARNING: lib not found: Qt53DAnimation.dll dependency of C:\users\shop 129 c\appdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtQu ick\Scene3D\qtquickscene3dplugin.dll 30813 WARNING: lib not found: Qt53DRender.dll dependency of C:\users\shop 129 c\ appdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick \Scene3D\qtquickscene3dplugin.dll 30843 WARNING: lib not found: Qt53DCore.dll dependency of C:\users\shop 129 c\ap pdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\S cene3D\qtquickscene3dplugin.dll 31251 WARNING: lib not found: Qt5MultimediaQuick_p.dll dependency of C:\users\sh op 129 c\appdata\local\programs\python\python37-32\lib\site-packages\PyQt5\Qt\qm l\QtMultimedia\declarative_multimedia.dll 34212 INFO: Looking for eggs 34212 INFO: Using Python library c:\users\shop 129 c\appdata\local\programs\pyth on\python37-32\python37.dll
【问题讨论】:
【参考方案1】:您是否尝试过创建python virtual environment,然后安装所有需要的软件包并使用 pyinstaller?这可能会起作用,甚至输出的可执行文件也非常苗条。
【讨论】:
是的,我已经做了 Python 虚拟环境,但还是一样。【参考方案2】:确保将 DLL 的路径添加到环境 PATH 变量中。看起来 pyinstaller 在搜索您拥有的所有依赖项时无法找到此 dll,因此在运行时尝试启动您的应用程序时它无法找到。
在某些情况下,它可能只是 pyinstaller 的错误,因此需要使用 --add-data
选项手动添加 dll:https://pyinstaller.readthedocs.io/en/stable/usage.html(更多详细信息)
测试一切是否正常的一种基本方法是在创建的 _MEIxxxxxx 临时文件夹中手动添加 dll 并重新启动 exe。
【讨论】:
以上是关于警告:找不到库:Qt5WebKitd.dll、Qt5Cored.dll pyinstaller的主要内容,如果未能解决你的问题,请参考以下文章
516808 警告:找不到库:c 的 api-ms-win-crt-time-l1-1-0.dll 依赖项
警告 MSB3283:找不到类型库“MSComctlLib”的包装程序集。构建我的应用程序时
PHP 警告:PHP 启动:无法加载动态库 '\xampp\php\ext\php_mailparse.dll' - 找不到指定的模块