PyInstaller 和 Poppler [英] PyInstaller and Poppler
问题描述
我正在开发一个可以显示 pdf 文件的 Python 应用程序.我试着用python-poppler-qt4 绑定.
目前没有问题.但我还需要构建一个独立的程序可执行文件.为此,我想使用 PyInstaller.
PyInstaller 似乎不支持 Poppler.我该如何解决这个问题?
您遇到的问题是什么?
我已经使用 python-poppler-qt4 为使用 PyInstaller 打包的 Windows 编写了很多程序,我遇到的唯一问题是 PyQt4.QtXml
依赖项没有自动导入.>
这可以通过创建一个名为 hook-popplerqt4.py
的文件来解决:
hiddenimports = ['PyQt4.QtXml']
将此文件与其他钩子一起保存
/PyInstaller/hooks
你应该没事了.
如果您仍然遇到问题,请发布您的错误,以便我们更好地了解问题所在.
Im working on an Python application that can show pdf files. I tried to use the python-poppler-qt4 Binding.
So far no problem. But it is also neceseery that i can build a stand alone executable of the programm. For this I want to use PyInstaller.
It seems that PyInstaller doesnt support Poppler. How can I go around this?
What is the issue that you are hitting?
I've written quite a few programs for Windows packaged using PyInstaller using python-poppler-qt4 and the only problem I had was that the PyQt4.QtXml
dependency wasn't imported automatically.
This can be fixed by creating a file named hook-popplerqt4.py
with the contents:
hiddenimports = ['PyQt4.QtXml']
Save this file with the other hooks in
<PyInstaller Root>/PyInstaller/hooks
and you should be good to go.
If you're still getting issues, post your error so that we have a better idea of what the problem is.
这篇关于PyInstaller 和 Poppler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!