使用pyinstaller时缺少dll文件
Missing dll files when using pyinstaller
美好的一天!
我正在使用 python 3.5.2 和 qt5、pyqt5 和 sip14.8。
我也在使用最新的 pyinstaller bracnch (3.3.dev0+g501ad40)。
我正在尝试为基本的 hello world 程序创建一个 exe 文件。
from PyQt5 import QtWidgets
import sys
class newPingDialog(QtWidgets.QMainWindow):
def __init__(self):
super(newPingDialog, self).__init__()
self.setGeometry(50, 50, 500, 300)
self.setWindowTitle("hello!")
self.show()
app = QtWidgets.QApplication(sys.argv)
GUI = newPingDialog()
sys.exit(app.exec_())
起初,我经常遇到一些关于 crt-msi 的错误。所以我重新安装了 SDK 和 c++ 运行时并将它们添加到我的环境中。
但现在我不断收到有关缺少 dll 的错误消息(qsvg、Qt5PrintSupport)
6296 WARNING: lib not found: Qt5Svg.dll dependency of C:\users\me\appdata\local\programs\python\python35\lib\site-pac
kages\PyQt5\Qt\plugins\imageformats\qsvg.dll
6584 WARNING: lib not found: Qt5Svg.dll dependency of C:\users\me\appdata\local\programs\python\python35\lib\site-pac
kages\PyQt5\Qt\plugins\iconengines\qsvgicon.dll
6992 WARNING: lib not found: Qt5PrintSupport.dll dependency of C:\users\me\appdata\local\programs\python\python35\lib
\site-packages\PyQt5\Qt\plugins\printsupport\windowsprintersupport.dll
7535 WARNING: lib not found: Qt5PrintSupport.dll dependency of c:\users\me\appdata\local\programs\python\python35\lib
\site-packages\PyQt5\QtPrintSupport.pyd
8245 INFO: Looking for eggs
8245 INFO: Using Python library c:\users\me\appdata\local\programs\python\python35\python35.dll
8246 INFO: Found binding redirects:
我已经检查过,两个 dll 都存在并且设置了它们的 PATH。我也尝试手动将它们添加到我的 dist 文件夹,但没有帮助。
如果您有任何建议,我将不胜感激!
这可能更像是一种解决方法,Pyinstaller 可能需要修复。
我发现 --paths
参数指向包含 Qt5Core.dll、Qt5Gui.dll[=18= 的目录],等帮助
pyinstaller --paths C:\Python35\Lib\site-packages\PyQt5\Qt\bin hello.py
通常添加 --Path
参数指向包含未找到库的目录可以解决问题。如果您使用的是 PyInstaller 3.3dev,则命令字符串解析可能会出现问题。如果路径包含空格,通常会发生这种情况。在这种情况下,您可以修改 PyInstaller 生成的 .spec
文件中的 pathex
参数,然后使用 PyInstaller 运行 来构建可执行文件。
pyinstaller file_name.spec
希望这个问题能尽快解决......
此问题现已在 PyInstaller 的最新开发分支中得到修复,请参阅 this Issue for PyInstaller on GitHub。
我在 github 和 Whosebug 上阅读了有关此问题的所有复杂解决方案。
但是,下面的简单解决方案对我有用:
第一步:pip3卸载pyinstaller
第 2 步:pip 安装 pyinstaller
第 3 步:pyinstaller --onefile filename.py
我在两台面临相同问题的不同计算机上尝试了此解决方案。
两者都有效。
如果这也适用于您,请告诉我。在那之后竖起大拇指将不胜感激。
干杯
26095 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\user\appdata\local\programs\python\python36-32\DLLs\select.pyd
在C盘搜索dll,在pyinstaller命令中设置路径。以下命令修复了 windows 10:
中的上述 pyinstaller 错误
pyinstaller --paths "C:\Windows\WinSxS\x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_10.0.17134.1_none_50c6cb8431e7428f" hello.py
可以使用"pyinstaller --onefile filename.py"。 exe文件将在dist文件夹中创建
美好的一天!
我正在使用 python 3.5.2 和 qt5、pyqt5 和 sip14.8。 我也在使用最新的 pyinstaller bracnch (3.3.dev0+g501ad40)。
我正在尝试为基本的 hello world 程序创建一个 exe 文件。
from PyQt5 import QtWidgets
import sys
class newPingDialog(QtWidgets.QMainWindow):
def __init__(self):
super(newPingDialog, self).__init__()
self.setGeometry(50, 50, 500, 300)
self.setWindowTitle("hello!")
self.show()
app = QtWidgets.QApplication(sys.argv)
GUI = newPingDialog()
sys.exit(app.exec_())
起初,我经常遇到一些关于 crt-msi 的错误。所以我重新安装了 SDK 和 c++ 运行时并将它们添加到我的环境中。 但现在我不断收到有关缺少 dll 的错误消息(qsvg、Qt5PrintSupport)
6296 WARNING: lib not found: Qt5Svg.dll dependency of C:\users\me\appdata\local\programs\python\python35\lib\site-pac
kages\PyQt5\Qt\plugins\imageformats\qsvg.dll
6584 WARNING: lib not found: Qt5Svg.dll dependency of C:\users\me\appdata\local\programs\python\python35\lib\site-pac
kages\PyQt5\Qt\plugins\iconengines\qsvgicon.dll
6992 WARNING: lib not found: Qt5PrintSupport.dll dependency of C:\users\me\appdata\local\programs\python\python35\lib
\site-packages\PyQt5\Qt\plugins\printsupport\windowsprintersupport.dll
7535 WARNING: lib not found: Qt5PrintSupport.dll dependency of c:\users\me\appdata\local\programs\python\python35\lib
\site-packages\PyQt5\QtPrintSupport.pyd
8245 INFO: Looking for eggs
8245 INFO: Using Python library c:\users\me\appdata\local\programs\python\python35\python35.dll
8246 INFO: Found binding redirects:
我已经检查过,两个 dll 都存在并且设置了它们的 PATH。我也尝试手动将它们添加到我的 dist 文件夹,但没有帮助。
如果您有任何建议,我将不胜感激!
这可能更像是一种解决方法,Pyinstaller 可能需要修复。
我发现 --paths
参数指向包含 Qt5Core.dll、Qt5Gui.dll[=18= 的目录],等帮助
pyinstaller --paths C:\Python35\Lib\site-packages\PyQt5\Qt\bin hello.py
通常添加 --Path
参数指向包含未找到库的目录可以解决问题。如果您使用的是 PyInstaller 3.3dev,则命令字符串解析可能会出现问题。如果路径包含空格,通常会发生这种情况。在这种情况下,您可以修改 PyInstaller 生成的 .spec
文件中的 pathex
参数,然后使用 PyInstaller 运行 来构建可执行文件。
pyinstaller file_name.spec
希望这个问题能尽快解决......
此问题现已在 PyInstaller 的最新开发分支中得到修复,请参阅 this Issue for PyInstaller on GitHub。
我在 github 和 Whosebug 上阅读了有关此问题的所有复杂解决方案。 但是,下面的简单解决方案对我有用:
第一步:pip3卸载pyinstaller
第 2 步:pip 安装 pyinstaller
第 3 步:pyinstaller --onefile filename.py
我在两台面临相同问题的不同计算机上尝试了此解决方案。 两者都有效。 如果这也适用于您,请告诉我。在那之后竖起大拇指将不胜感激。 干杯
26095 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\user\appdata\local\programs\python\python36-32\DLLs\select.pyd
在C盘搜索dll,在pyinstaller命令中设置路径。以下命令修复了 windows 10:
中的上述 pyinstaller 错误pyinstaller --paths "C:\Windows\WinSxS\x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_10.0.17134.1_none_50c6cb8431e7428f" hello.py
可以使用"pyinstaller --onefile filename.py"。 exe文件将在dist文件夹中创建