将 PyQwt 与 py2exe 捆绑在一起
我有一个 py2exe 的标准安装脚本,我可以使用该脚本将基于 PyQt 的应用程序捆绑到 Windows .exe 文件中。
今天我尝试了一个使用 PyQwt 模块的简单脚本,但它似乎不起作用。 py2exe 运行正常,但是当我执行它创建的 .exe 时,它将以下内容转储到日志文件中并且不运行:
Traceback (most recent call last):
File "qwt_test.pyw", line 5, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "PyQt4\Qwt5\__init__.pyo", line 32, in <module>
File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading PyQt4\Qwt5\Qwt.pyd
当我在 build\ 中查看
目录下,PyQt4\Qwt5\
时bdist.win32\winexe\collect-2.5Qwt.pyd
肯定在那里。
我似乎无法在网上找到任何关于此错误的有用信息。 什么可能导致它? 谢谢。
I have a standard setup script for py2exe with which I bundle PyQt-based applications into Windows .exe files.
Today I tried a simple script that uses the PyQwt module, and it doesn't seem to work. py2exe runs alright, but when I execute the .exe it creates, it dumps the following into a log file and doesn't run:
Traceback (most recent call last):
File "qwt_test.pyw", line 5, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "PyQt4\Qwt5\__init__.pyo", line 32, in <module>
File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading PyQt4\Qwt5\Qwt.pyd
When I look in PyQt4\Qwt5\
in the build\bdist.win32\winexe\collect-2.5
directory, Qwt.pyd
is definitely there.
I can't seem to find anything useful online regarding this error. What could cause it? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
py2exe 不是为 Python 应用程序组合 exe 文件的唯一方法,也可能不是最好的方法——特别是,它几乎不支持 pyqt。 请,我恳求你,查看 PyInstaller,它确实了解 PyQt(以及 Linux 和 Mac,应该你关心...) - 只需确保您使用 SVN head checkout,而不是“已发布”版本,该版本此时已经严重过时(希望很快就会消失的问题...)。
py2exe is not the only way, and maybe not the best way, to put together exe files for Python apps -- in particular, it hardly if at all supports pyqt. Please, I beseech you, check out PyInstaller, which DOES know about PyQt (and Linux, and Mac, should you care...) -- just make sure you use the SVN head checkout, not the "released" version, which at this time is seriously out of date (an issue that's hopefully going away soon...).
一些选项:
bundle_files 选项
(3, 2, 1)(特别是如果您将它们全部放在一个大库 zip 中,某些 dll 不喜欢这样)。msvcp71.dll
的副本。Some options:
bundle_files options
(3, 2, 1) (especially if you put them all in one big library zip, some dlls don't like that).msvcp71.dll
exists under windows\system32 or in the directory of your executable.dll_excludes
option and (after building) copy Qwt.pyd (and _Qwt.pyd if it exists) to your executable path.