This is quite an old issue. I don't know about Tk, but Qt explicitly states that there must be only one QApplication <http://doc.qt.io/qt-5/qapplication.html>:
For any GUI application using Qt, there is precisely *one* QApplication > <http://doc.qt.io/qt-5/qapplication.html> object, no matter whether the > application has 0, 1, 2 or more windows at any given time. > The problem is that Spyder is already a Qt application, so you can't instantiate a new one. You may argue that each console has its own process, but due to the way Spyder interacts with IPython, it also already has Qt instantiated. Anyway, the workaround is to check if there's already a QApplication "out there" and use it. Here's the snippet I use in my apps: if __name__ == '__main__': > existing = QtGui.qApp.instance() > if existing: > app = existing > else: > app = QtGui.QApplication(sys.argv) > wnd = WndMain() > if existing: > self = wnd > else: > sys.exit(app.exec_()) > You may not want to use the `self = wnd` trick, but I find it useful to troubleshoot class methods with F9 in Spyder. 2016-04-10 15:28 GMT-03:00 Carlos Córdoba <[email protected]>: > Hi Eric, > > Please open an issue in our Github website: > > https://github.com/spyder-ide/spyder > > and upload there simple code examples that are generating the crashes for > you, so we can reproduce and fix this problem in our side. > > > Cheers, > Carlos > > El 09/04/16 a las 18:13, Eric Shain escribió: > > I crash the iPython console if I run any gui code in the editor. Either QT > or Tk. > > Eric > > On Wednesday, April 6, 2016 at 7:33:32 PM UTC-5, Eric Shain wrote: >> >> Mostly, but I'm getting freezes and crashes. Rebooting the kernel isn't >> helping either. Really just not a reliable situation right now. >> >> Eric >> >> On Wednesday, April 6, 2016 at 2:16:51 PM UTC-5, Carlos Córdoba wrote: >>> >>> Does evaluation work with Shift+Enter instead of just Enter? >>> >>> El 06/04/16 a las 10:02, Eric Shain escribió: >>> >>> I'm having the same issue. It's making Spyder essentially unusable. >>> >>> Eric >>> >>> On Thursday, March 24, 2016 at 3:57:13 AM UTC-5, Julien Hillairet wrote: >>>> >>>> Is the issue the same that : >>>> https://github.com/spyder-ide/spyder/issues/2696 >>>> or >>>> https://github.com/spyder-ide/spyder/issues/2711 >>>> >>>> ? >>>> >>>> 2016-03-23 19:19 GMT+01:00 rick debbout <[email protected]>: >>>> >>>>> I am unable to write lines and execute in the ipython console in >>>>> spyder. I am however, able to run lines that I type into the editor and >>>>> use the F9 quick key for 'run selection'. I've tried restarting the >>>>> kernel >>>>> with no luck, I can restart Spyder and it will sometimes work and >>>>> sometimes >>>>> not. This isn't a huge issue, but one I would like to understand more, >>>>> thanks for any help >>>>> >>>>> ~rickD >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "spyder" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To post to this group, send email to [email protected]. >>>>> Visit this group at <https://groups.google.com/group/spyderlib> >>>>> https://groups.google.com/group/spyderlib. >>>>> For more options, visit <https://groups.google.com/d/optout> >>>>> https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "spyder" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at https://groups.google.com/group/spyderlib. >>> For more options, visit https://groups.google.com/d/optout. >>> >>> >>> -- > You received this message because you are subscribed to the Google Groups > "spyder" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/spyderlib. > For more options, visit https://groups.google.com/d/optout. > > > -- > You received this message because you are subscribed to the Google Groups > "spyder" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/spyderlib. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "spyder" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/spyderlib. For more options, visit https://groups.google.com/d/optout.
