Hey ya guys, it's my first topic on DaniWeb, sounds like a good place to find help with programming. :)
Today I'm trying to compile a simple code made for PyQt4 using cx_Freeze, but I'm getting an error, I'll show you all the codes:
example.pyw
import sys
from PyQt4 import QtGui
def main():
app = QtGui.QApplication(sys.argv)
w = QtGui.QWidget()
w.resize(250, 150)
w.move(300, 300)
w.setWindowTitle('Example')
w.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
from cx_Freeze import setup, Executable
includes = ["sip","re"]
exe = Executable(
script="example.pyw",
base="Win32GUI"
)
setup(
options = {"build_exe": {"includes":includes}},
executables = [exe]
)
After compiling the code, while trying to run the .exe I'm getting the following error:
cx_Freeze: Python error in main script
Traceback (mot recent call last):
File "C:\Python\lib\site-packages\cx_Freeze\initscripts\Console3.py", line 27, in <module>
exec(code, m.__dict__)
File "example.pyw", line 2, in <module>
File "ExtensionLoader_PyQt4_QtGui.py", line 12, in <module>
ImportError: No module named QtCore