【发布时间】:2016-07-30 13:22:15
【问题描述】:
美好的一天!
我正在使用带有 qt5、pyqt5 和 sip14.8 的 python 3.5.2。 我也在使用最新的 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 文件夹,但没有帮助。
我将非常感谢您的任何建议!
【问题讨论】:
-
'在你的 exe 中插入一个
dll' 很难。尝试将as source添加到构建器配置中。from x import y与import x.y或import x.y as z不同的东西
标签: python qt dll pyinstaller