Error importing Pyinstaller QtCore module

I am trying to create my application with the --onefile option using pyinstaller. Here is an excerpt.

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:

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

I am creating this from Ubuntu 13. Anyone with an idea why this is happening?

+6
source share
1 answer

In the current version of PyInstaller, an error occurs that causes this problem. See ticket for more details.

The good news is that it is fixed. The bad news is that it just arrived in PyInstaller 2.2. At the same time, you can try installing the PyInstaller assembly to solve this problem.

+6
source

Source: https://habr.com/ru/post/969421/


All Articles