简体   繁体   中英

Kernel error in spyder and jupyter notebook

I tried to use the Anaconda Navigator, but I'm getting this kernel error.

I had previously installed python 3.8 without Anaconda and had installed jupyter in it using pip, then I uninstalled it and installed Anaconda again.

Since then this error arises whenever I try to compile a file and even in the jupyter notebook.

I tried : 1.) Reinstalling Anaconda 2.) Updating the setup tools

None of these worked.

Traceback (most recent call last):
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\tornado\web.py", line 1699, in _execute
    result = await result
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
    type=mtype))
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\tornado\gen.py", line 209, in wrapper
    yielded = next(result)
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\jupyter_client\manager.py", line 240, in start_kernel
    self.write_connection_file()
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\jupyter_client\connect.py", line 547, in write_connection_file
    kernel_name=self.kernel_name
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\jupyter_client\connect.py", line 212, in write_connection_file
    with secure_write(fname) as f:
  File "C:\Users\DELLL\Anaconda3\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "C:\Users\DELLL\Anaconda3\lib\site-packages\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\\DELLL\\AppData\\Roaming\\jupyter\\runtime\\kernel-4058ed7c-98d6-40c9-8b3b-2cbb069740d8.json'

Issue resolved.

The problem:

I had previously installed jupyter using pip install, when I was working on python 3.8. Now, I uninstalled python 3.8 and installed Anaconda instead. This again reinstalled jupyter, thus was the cause of the problem.

To resolve this, I uninstalled jupyter from AnacondaPrompt using conda uninstall jupyter , and then reinstalled it, this time from conda install jupyter . This resolved the kernel error.

This is permission issue for that particular folder Set the environment path variables C:\\Users\\DELL\\AppData\\Roaming\\jupyter\\runtime

give the permission and it will work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM