Open mscheltienne opened 3 years ago
Now that I think about it, I do have the Qt5 backend set in the settings of the IPython console.
Hi @mscheltienne, thanks for the detailed issue report. @ccordoba12, do you know what could be happening here? Also, are you using one of our installers?
@andfoy Hello, no this is not through one of the installers but through pip.
A few guess/important points:
When the spyder-kernels is not installed, a very nice message asking to install it in the venv is displayed in the console. A similar message checking the required dependencies (if matplotlib is installed, it also needs the backend) and asking to install them would be helpful. I don't know much about the kernel and the IPYthon console, maybe there are also over dependencies that are not checked?
I guess this problem was not observed often, as for most people, the kernel is in the same environment as spyder; which does require pyqt5 to be installed in the first place.
Now that I think about it, I do have the Qt5 backend set in the settings of the IPython console.
This is really the problem. We're not doing a check of the selected Matplotlib backend in the kernel to determine if we can actually set it or not. It shouldn't be easier to add it though and show a message to users telling that it's missing.
However, we perform checks for the Automatic
backend, i.e. we check if Qt5
, then Tk
can be set. If not, we resort to the Inline
backend. So I'd suggest you to use that option in the meantime.
Problem Description
I have a python installation 3.8.10 (also tried 3.9.6) on Windows. On this installation, I have spyder installed via pip. I have multiple venv in a folder:
Documents\pyvenv
. Each venv has the spyder-kernels installed so that the global spyder installation can have a working IPyton console connected to the proper kernel by changing the setting:My antivirus/Firewall has both my python installation and my venv whitelisted. Today, some of the IPython console could connect to some of the venv and not to others, staying stuck on 'Connecting to kernel'.
It took me a while to figure out what was causing this: having
matplotlib
installed on the venv withoutpyqt5
. I was not expecting that.. and I can't figure out the link betweenmatplotlib
,pyqt5
and thespyder-kernels
.What steps reproduce the problem?
py -m venv test
and activate it.(test) py -m pip install --upgrade pip setuptools wheel
(test) py -m pip install spyder-kernels
At this point, everything is working.
(test) py -m pip install matplotlib
We can wait a while...
(test) py -m pip install pyqt5
And it's back !
Notes
I tested this for a while, in multiple venv and on 2 installations of python. It doesn't matter if
pyqt5
is installed before or aftermatplotlib
; but as long as both are not installed in the venv, the console is stuck in 'Connecting to kernel'.Versions
Dependencies