Spyder: Console stuck in connecting to kernel upon starting spyder

Created on 7 Mar 2018  路  14Comments  路  Source: spyder-ide/spyder

Problem Description

What steps will reproduce the problem?

Starting spyder after the latest update.
Console is stuck in "connecting to kernel"

Traceback

  File "C:\Conda\envs\py36\lib\site-packages\spyder\plugins\__init__.py", line 514, in <lambda>
    toggled=lambda checked: self.toggle_view(checked),
  File "C:\Conda\envs\py36\lib\site-packages\spyder\plugins\ipythonconsole.py", line 725, in toggle_view
    self.create_new_client(give_focus=False)
  File "C:\Conda\envs\py36\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1038, in create_new_client
    self.connect_client_to_kernel(client)
  File "C:\Conda\envs\py36\lib\site-packages\spyder\plugins\ipythonconsole.py", line 1073, in connect_client_to_kernel
    kc.start_channels(shell=True, iopub=True)
  File "C:\Conda\envs\py36\lib\site-packages\qtconsole\kernel_mixins.py", line 43, in start_channels
    super(QtKernelClientMixin, self).start_channels(*args, **kw)
  File "C:\Conda\envs\py36\lib\site-packages\jupyter_client\threaded.py", line 212, in start_channels
    self.shell_channel._inspect = self._check_kernel_info_reply
  File "C:\Conda\envs\py36\lib\site-packages\jupyter_client\client.py", line 143, in shell_channel
    socket, self.session, self.ioloop
  File "C:\Conda\envs\py36\lib\site-packages\jupyter_client\threaded.py", line 205, in ioloop
    self._ioloop = ioloop.IOLoop()
  File "C:\Conda\envs\py36\lib\site-packages\tornado\util.py", line 312, in __new__
    instance.initialize(*args, **init_kwargs)
  File "C:\Conda\envs\py36\lib\site-packages\zmq\eventloop\ioloop.py", line 139, in initialize
    super(ZMQIOLoop, self).initialize(impl=impl, **kwargs)
  File "C:\Conda\envs\py36\lib\site-packages\tornado\ioloop.py", line 845, in initialize
    super(PollIOLoop, self).initialize(**kwargs)
  File "C:\Conda\envs\py36\lib\site-packages\tornado\ioloop.py", line 357, in initialize
    self.make_current()
  File "C:\Conda\envs\py36\lib\site-packages\tornado\ioloop.py", line 315, in make_current
    assert asyncio is None
AssertionError

Package Versions

  • Spyder 3.2.7 ``
  • Python 3.6.4
  • Qt 5.10.0
  • PyQt5 5.10
  • Windows 10

Dependencies

pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.22.0 (OK)
numpy >=1.7      :  1.14.1 (OK)
sphinx >=0.6.6   :  1.7.1 (OK)
rope >=0.9.4     :  0.10.7 (OK)
jedi >=0.9.0     :  0.11.1 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
cython >=0.21    :  0.27.3 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.2.1 (OK)
pylint >=0.25    :  1.8.2 (OK)
Duplicate

Most helpful comment

Downgrading tornado back to 4.5.3 fixed the issue.

All 14 comments

Downgrading tornado back to 4.5.3 fixed the issue.

With a lot of trial and error and reading many things i don't understand, it seems
tornado 5.0 is causing the problem, revert to previous version

This is a duplicate of #6627 ; and in any case outside of Spyder's control. To fix for now, run conda install tornado=4.5.3 from the Anaconda Prompt/Terminal/shell (Windows/Mac/Linux) in the conda environment that Spyder is installed in.

unable to fix the issue even after installing tornado 4.5.3

unable to fix the issue even after installing tornado 4.5.3

Did you find a solution?

I had the same problem and doing "conda update --all" solved the problem.
This solution was proposed on https://github.com/spyder-ide/spyder/issues/6627

Note: If you do this while an existing kernel is open, you will be able to connect to it, but you will not see any output or errors in the IPython console. You will need to restart the kernel (or leave it ("quit") and start another) for it to work properly.

Downgrading tornado back to 4.5.3 fixed the issue.

I t worked for me. Thanks!

I first updated ipykernel: conda upgrade ipykernel
Next, I downgraded tornado: conda install tornado=4.5.3

Done, problem solved in Spyder using Python 3.7 (Anaconda distribution) in windows 10.

I solved this problem this way:

First, I updated ipykernel: conda upgrade ipykernel
Next, I downgraded tornado: conda install tornado=4.5.3

Done, problem solved in Spyder using Python 3.7.x (Anaconda distribution) in windows 10.

@PoissonChasseur. Your suggestion (conda update --all) worked for me, but only after I deleted the ~/.ipython directory. That seems to be relevant.

pip install ipykernel --upgrade

@tsbankole Please do not simply suggest arbitrary commands without any context. The above command has a good chance of breaking the great majority of Spyder installs (due to them being conda-based and installing a conflicting package via pip).

@ccordoba12 ^

I'm sorry @tsbankole but I'm going to hide your comment (along with ours) to avoid issues for future users reading this issue.

As @CAM-Gerlach said, you should use conda update ipykernel if you're using Anaconda and pip otherwise.

I tried pip install tornado==4.5.3, and the issue was solved

@ccordoba12 ^

Was this page helpful?
0 / 5 - 0 ratings