Spyder: Issue with connecting to existing kernel in Spyder

Created on 28 Nov 2017  路  6Comments  路  Source: spyder-ide/spyder

Description of your problem

What steps will reproduce the problem?

  1. Open Spyder
  2. select Connect to Existing Kernel from Consoles
  3. add relevant information (.json path, select This is a Remote Kernel, Host Name, and password)
  4. select OK
    Alternatively,
    try
    jupyter qtconsole --existing kernel-*.json in Conda prompt

What is the expected output? What do you see instead?
be able to connect to the existing kernel
but the console continue throwing following error and never connects:
from IPython.core.usage import quick_guide
ImportError: cannot import name 'quick_guide'
WARNING:traitlets:kernel died: 3.005441904067993
WARNING:traitlets:kernel died: 3.0068752765655518
WARNING:traitlets:kernel died: 3.006462574005127
WARNING:traitlets:kernel died: 3.004634380340576
WARNING:traitlets:kernel died: 3.0096800327301025
WARNING:traitlets:kernel died: 3.0049967765808105
WARNING:traitlets:kernel died: 3.0088624954223633
WARNING:traitlets:kernel died: 3.000904083251953
WARNING:traitlets:kernel died: 3.005671501159668
WARNING:traitlets:kernel died: 3.0018441677093506
WARNING:traitlets:kernel died: 3.0125861167907715
WARNING:traitlets:kernel died: 3.022031545639038
WARNING:traitlets:kernel died: 3.0107312202453613
WARNING:traitlets:kernel died: 3.001008987426758
WARNING:traitlets:kernel died: 3.0071825981140137
WARNING:traitlets:kernel died: 3.0054385662078857
WARNING:traitlets:kernel died: 3.003704786300659
WARNING:traitlets:kernel died: 3.002899169921875
WARNING:traitlets:kernel died: 3.005674362182617
WARNING:traitlets:kernel died: 3.003570795059204
WARNING:traitlets:kernel died: 3.008498191833496
WARNING:traitlets:kernel died: 3.0049331188201904
WARNING:traitlets:kernel died: 3.0033140182495117
WARNING:traitlets:kernel died: 3.0054147243499756
WARNING:traitlets:kernel died: 3.002737522125244
WARNING:traitlets:kernel died: 3.002110719680786

Please provide any additional information below

Versions and main components

  • Spyder Version: 3.1.2
  • Python Version: 3.6
  • Qt Version:
  • PyQt Version:
  • Operating system: Win10

Dependencies

jedi >=0.8.1 : 0.10.2 (OK)
matplotlib >=1.0 : 2.1.0 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.13.3 (OK)
pandas >=0.13.1 : 0.21.0 (OK)
pep8 >=0.6 : 1.7.0 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.7.4 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.5 (OK)
sphinx >=0.6.6 : 1.6.3 (OK)
sympy >=0.7.3 : 1.1.1 (OK)

IPython Console Bug

Most helpful comment

Thanks for the response. I started with the latest Spyder version (3.2.4) and when saw the error then I rolled back to 3.1.2 and then 3.1.4 but the issue still persists. We've tried this with both Python 2.7 and Python3.4.

I traced back the issue to the CODECS.PY and CLIENT.PY and following is the issue:
CODECS.PY (line# 895) and CLIENT.PY (line# 385)

file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\USER_ACCOUNT\AppData\Local\Temp\spyder\kernel-**.stderr'
WARNING:traitlets:kernel died: 3.0004758834838867
Traceback (most recent call last):
File "C:\Users\USER_ACCOUNT\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\widgets\ipythonconsole\client.py", line 385, in kernel_restarted_message
encoding='utf-8').read()
File "C:\Users\USER_ACCOUNT\AppData\Local\Continuum\anaconda3\lib\codecs.py", line 895, in open

CODECS.PY (line# 895)

   if encoding is not None and \
       'b' not in mode:
        # Force opening of the file in binary mode
        mode = mode + 'b'
    **file = builtins.open(filename, mode, buffering)**
    if encoding is None:
        return file
    info = lookup(encoding)

CLIENT.PY (line# 385)

 @Slot(str)
    def kernel_restarted_message(self, msg):
        """Show kernel restarted/died messages."""
        try:
            stderr = codecs.open(self.stderr_file, 'r',
                                 **encoding='utf-8').read()**

All 6 comments

Thanks for reporting. This appears to be a duplicate of #4170 , which was fixed in Spyder 3.1.4. Please upgrade to at least version, or even better the latest Spyder (3.2.4 now). As such, this issue can be closed.

Thanks for the response. I started with the latest Spyder version (3.2.4) and when saw the error then I rolled back to 3.1.2 and then 3.1.4 but the issue still persists. We've tried this with both Python 2.7 and Python3.4.

I traced back the issue to the CODECS.PY and CLIENT.PY and following is the issue:
CODECS.PY (line# 895) and CLIENT.PY (line# 385)

file = builtins.open(filename, mode, buffering)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\USER_ACCOUNT\AppData\Local\Temp\spyder\kernel-**.stderr'
WARNING:traitlets:kernel died: 3.0004758834838867
Traceback (most recent call last):
File "C:\Users\USER_ACCOUNT\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\widgets\ipythonconsole\client.py", line 385, in kernel_restarted_message
encoding='utf-8').read()
File "C:\Users\USER_ACCOUNT\AppData\Local\Continuum\anaconda3\lib\codecs.py", line 895, in open

CODECS.PY (line# 895)

   if encoding is not None and \
       'b' not in mode:
        # Force opening of the file in binary mode
        mode = mode + 'b'
    **file = builtins.open(filename, mode, buffering)**
    if encoding is None:
        return file
    info = lookup(encoding)

CLIENT.PY (line# 385)

 @Slot(str)
    def kernel_restarted_message(self, msg):
        """Show kernel restarted/died messages."""
        try:
            stderr = codecs.open(self.stderr_file, 'r',
                                 **encoding='utf-8').read()**

@BadriTiwari, please submit a pull request with your fixes because I don't understand them. Also, please don't forget to make it against our 3.x branch.

Sorry, @BadriTiwari my mistake and thanks for your detailed followup.; since you only listed an older version that had a seemingly very similar bug in the original post I jumped prematurely to the conclusion that it was a likely duplicate.

I had the same problem, and I was able to handle it, when I took de ssh key generated by mobaXterm and put it in the "ssh key" field (found in C:\Users\xxxxx\Documents\MobaXterm\home.ssh\hostkeys)

Closing because I have no idea what's this about, sorry.

Was this page helpful?
0 / 5 - 0 ratings