0

Guys I'm having trouble in compiling my python script to 'exe' using py2exe. When I run the setup script, it doesn't throw up any errors. But the 'exe' is not generated. Also, the 'dist' and 'build' directories are empty. My program uses PyQt4. When I remove the pyqt imports from my program, it compiles successfully and the exe is generated. I think there is some problem when Qt is imported.

The setup script looks like this.

import sys
from distutils.core import setup
import py2exe

sys.argv.append('py2exe')

setup(console=['larynx.pyw'])

My Gui program is this one.

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from interface import Ui_MainWindow

class Window(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)

        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

app = QApplication(sys.argv)
window = Window()
window.show()

sys.exit(app.exec_())

The output when the setup script is run.

freeMinder
  • 81
  • 1
  • 2
  • 8
  • Strange: have you tried from PyQt4 import * instead of your two import statements? – duhaime Aug 06 '14 at 14:44
  • 1
    Sorry guys.. I solved the problem. It was just a MSVCP90.dll missing error. It wouldn't show up in the IDLE shell. When I ran the setup script from the command prompt, it showed the error. – freeMinder Aug 07 '14 at 10:44

0 Answers0