0

Every time I create a vispy Canvas instance in Spyder:

from vispy import app

class Canvas(app.Canvas):
    def __init__(self):
        app.Canvas.__init__(self)

canvas = Canvas()

I start to get warnings like the following in the iPython window:

WARNING: QSocketNotifier: Multiple socket notifiers for same socket 1048 and type Read

Once the canvas instance is created, whenever I type in the iPython console in Spyder, this error starts to occur, so I can't do things like explore modules via tab completion (the warning obliterates the dropdown menu). It also tends to randomly insert itself in stack traces and other places in the console, generally disrupting my workflow (in non-catastrophic ways).

I tried turning off the Warning by turning off Real-time code analysis, as suggested here:
How to suppress a certain warning in Spyder editor?
But it didn't affect the behavior.

I am in Spyder version: 3.2.8 (in an environment that includes spyder-kernels 0.2.6), Python version: 3.6.6, Qt version: 5.6.2, PyQt5 version: 5.6 in Windows 10. This has happened on all three Windows 10 machines I use. I'm running this all in Anaconda. When I run the above code just in the python shell, or from the pure iPython shell, I do not get the warning.

eric
  • 7,142
  • 12
  • 72
  • 138
  • (*Spyder maintainer here*) Does the same warning is shown in a terminal Python or IPython interpreters? – Carlos Cordoba Nov 10 '18 at 21:35
  • @CarlosCordoba it doesn't happen in the python/iPython shell. Note in case it matters I am using Anaconda, and in an environment that also has `spyder-kernels 1.1.0`. Note also I just tested this on a newer setup (with Python 3.7, and newest Spyder) and I am not getting this warning. That said, I am using an application that uses 3.6 and vispy so I can't just switch. But I do realize that means this problem should probably be a low priority. :) – eric Nov 11 '18 at 03:27
  • 1
    I'd say this is problem with Vispy trying to use its Qt backend in the same console as Spyder has created a Qt application (with `%gui qt`), but it's hard to tell for me without going deeper into this issue, for which I don't have time, sorry. – Carlos Cordoba Nov 11 '18 at 04:24
  • @CarlosCordoba good eye: before the magic (`%gui qt`) I am not getting the warning, and after...I am. Unfortunately I need to enter the magic to get vispy to work. – eric Nov 19 '18 at 18:22
  • 1
    Yeah, I'm sure you need to run `%gui qt` to use the Vispy's Qt backend. So I think you two choices here: 1) Use a different Vispy backend (I think Vispy comes with several backends); and 2) Open an issue in the Vispy issues tracker and talk to its devs to see if this can be solved on their side (e.g. by trying to detect if a Qt app is already running and not creating a new one in that case). – Carlos Cordoba Nov 19 '18 at 22:02
  • It seems there is a workaround: https://github.com/vispy/vispy/issues/1787 – eric Jul 14 '20 at 14:24

0 Answers0