0

I try to build an interface. I installed PyQt 5 (5.6.0) in Anaconda 3.6 (Python 3.6.3). I use Spyder (3.2.6) as my compiler.

import sys
from PyQt5 import QtGui,QtCore
from PyQt5.QtWidgets import QPushButton,QApplication,QMainWindow

class Window(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setGeometry(50,50,500,300)
        self.setWindowTitle("PyQt!")
        self.show()
if __name__ == "__main__":
    def run():
        App=QApplication(sys.argv)
        Window()
        App.exec()
    run()

There is no error while running this command. However, there is no output too. Shouldn't I see a window of 500 pixels x 300 pixels at (50, 50)?

Thanks for your insights :)

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Syd Xyn
  • 1
  • 1
  • Possible duplicate of [When running PyQt5 app in Spyder it always exits with -1](https://stackoverflow.com/questions/49094112/when-running-pyqt5-app-in-spyder-it-always-exits-with-1) – eyllanesc Apr 20 '18 at 16:27
  • Just to share with anyone else facing the same problem. I have yet solved the problem with PyQt5 and Spyder. I am settled with a workaround - I switch to another IDE i.e. Atom, which by default connects to Anaconda 3 with all libraries/ modules/ packages I have gone through so much to install, e.g. cv2, dlib and PyQt5. Atom is easy to use, the only thing I needed to configure upon installation, was to add an internal package "script" to click to run scripts. – Syd Xyn May 01 '18 at 00:11

0 Answers0