简体   繁体   English

Pyinstaller QtCore模块导入错误

[英]Pyinstaller QtCore Module import error

I am trying to build my app with --onefile option by pyinstaller. 我正在尝试使用pyinstaller的--onefile选项构建我的应用程序。 Here is the extract. 这是摘录。

import sys
from PyQt4 import QtGui, QtCore
from modules.login import Login

def main():
    app = QtGui.QApplication(sys.argv)
    app.setQuitOnLastWindowClosed(False)
    login = Login()
    login.show()
    sys.exit(app.exec_())


if __name__ == "__main__":
    main()    

I tried to build using: 我尝试使用以下方法构建:

 >pyinstaller --onefile app.py

Running the generated dist/app I get this error: 运行生成的dist / app我收到此错误:

Traceback (most recent call last):
  File "<string>", line 36, in <module>
ImportError: No module named QtCore

I am building this from Ubuntu 13. Anyone with an idea why this is happening? 我正在从Ubuntu 13构建这个。任何人都知道为什么会这样?

There is a bug in the current version of PyInstaller that causes this problem. 当前版本的PyInstaller中存在一个导致此问题的错误。 See this ticket for more details. 有关详细信息,请参阅此票证

The good news is that it's been fixed. 好消息是它已被修复。 The bad news is that it's only arriving in PyInstaller 2.2. 坏消息是它只到达PyInstaller 2.2。 In the mean time, you could try installing a development build of PyInstaller to solve this issue. 与此同时,您可以尝试安装PyInstaller的开发版本来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM