Spyder: Spyder "An error ocurred while starting the kernel" when I updated conda in anaconda prompt

Created on 14 Oct 2019  路  8Comments  路  Source: spyder-ide/spyder

Issue Report Checklist

  • [x] Searched the issues page for similar reports
  • [ ] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ ] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [ ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [ ] Tried basic troubleshooting (if a bug/error)

    • [ ] Restarted Spyder

    • [ ] Reset preferences with spyder --reset

    • [ ] Reinstalled the latest version of Anaconda

    • [ ] Tried the other applicable steps from the Troubleshooting Guide

  • [ ] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

This is my problem on the console
The error is:

Traceback (most recent call last):
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\spyder\plugins\ipythonconsole.py", line 1572, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle)
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\Users\Robert\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\jupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\Users\Robert\AppData\Roaming\jupyter\runtime\kernel饠偙d5611c0daf1.json'

What steps reproduce the problem?



    1. 2.
  1. 3.

What is the expected output? What do you see instead?

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE

Versions

  • Spyder version:
  • Python version:
  • Qt version:
  • PyQt version:
  • Operating System name/version:

Dependencies

PASTE DEPENDENCIES HERE
Awaiting Followup

Most helpful comment

jupyter_client 5.3.4 and jupyter_core 4.6.0 are now available in defaults

All 8 comments

Issue Report Checklist

  • [x] Searched the issues page for similar reports
  • [ ] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ ] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [ ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [ ] Tried basic troubleshooting (if a bug/error)

    • [ ] Restarted Spyder
    • [ ] Reset preferences with spyder --reset
    • [ ] Reinstalled the latest version of Anaconda
    • [ ] Tried the other applicable steps from the Troubleshooting Guide
  • [ ] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

This is my problem on the console
The error is:

Traceback (most recent call last):
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\spyder\plugins\ipythonconsole.py", line 1572, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle)
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\Users\Robert\Anaconda3\lib\contextlib.py", line 112, in enter
return next(self.gen)
File "C:\Users\Robert\Anaconda3\lib\site鈥憄ackages\jupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\Users\Robert\AppData\Roaming\jupyter\runtime\kernel饠偙d5611c0daf1.json'

What steps reproduce the problem?

What is the expected output? What do you see instead?

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE

Versions

  • Spyder version: 3.3.6
  • Python version: 3.7
  • Qt version:
  • PyQt version:
  • Operating System name/version:

Dependencies

PASTE DEPENDENCIES HERE

This error is fixed in jupyter_client 5.3.4 and jupyter_core 4.6.0. Unfortunately those versions are still not available in Anaconda.

@jjhelmus, sorry to bother you but could you give us a hand with updating those packages? Thanks!

jupyter_client 5.3.4 and jupyter_core 4.6.0 are now available in defaults

Thanks a lot @jjhelmus for your help! It's really appreciated by us!


@robbie-ferg, to fix this you need to open the Anaconda Prompt and run there

conda update jupyter_client jupyter_core

Hai...
@ccordoba12 i am also getting the error...
tried conda update jupyter_client jupyter_core .. still nothing changed.. throwing ipython console error..
Any thoughts..??

{An error ocurred while starting the kernel
The error is:

Traceback (most recent call last):
File "C:\Users\Asgard\Anaconda3\lib\site鈥憄ackages\spyder\plugins\ipythonconsole.py", line 1572, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle)
File "C:\Users\Asgard\Anaconda3\lib\site鈥憄ackagesjupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\Users\Asgard\Anaconda3\lib\site鈥憄ackagesjupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\Asgard\Anaconda3\lib\site鈥憄ackagesjupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\Users\Asgard\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\Asgard\Anaconda3\lib\site鈥憄ackagesjupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\Users\Asgard\AppData\Roaming\jupyter\runtime\kernel髨洘c9d119f30b.json'}

I am getting the same error. Tried update jupyter_client jupyter_core
Uninstalled all python installations and did a clean install of Anaconda. Still facing the same issue.
Although running spyder as an 'Administrator' works fine without error! I hope that gives some idea to fix this issue.
(Spyder 3.3.6, Python 3.7.4, Ipython 7.8.0)


An error ocurred while starting the kernel
The error is:

Traceback (most recent call last):
File "C:\Users\navee\Anaconda3\lib\site鈥憄ackages\spyder\plugins\ipythonconsole.py", line 1572, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle)
File "C:\Users\navee\Anaconda3\lib\site鈥憄ackagesjupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\Users\navee\Anaconda3\lib\site鈥憄ackagesjupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\navee\Anaconda3\lib\site鈥憄ackagesjupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\Users\navee\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\navee\Anaconda3\lib\site鈥憄ackagesjupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\Users\navee\AppData\Roaming\jupyter\runtime\kernel髨洤a24e4f83c1.json'

The solution is to open the Anaconda prompt and run there

conda update --all

@ccordoba12 Thanks a bunch, it worked! Assumed fresh installation of Anaconda would have the same effect as updating all, oh boy I was so wrong! My OCD was raising exponentially for the past 3 days!

Was this page helpful?
0 / 5 - 0 ratings