Anaconda3运行Jupyter notebook报错Kernel error

两盒软妹~` 提交于 2020-02-12 22:51:32

安装Anaconda3后运行Jupyter后,出现内核错误消息,如下所示:

Traceback (most recent call last):
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\tornado\web.py", line 1699, in _execute
    result = await result
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
    type=mtype))
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\User1\Anaconda3\Ana3\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\User1\Anaconda3\Ana3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "C:\Users\User1\Anaconda3\Ana3\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\User1\Anaconda3\Ana3\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\tornado\gen.py", line 209, in wrapper
    yielded = next(result)
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\jupyter_client\manager.py", line 240, in start_kernel
    self.write_connection_file()
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\jupyter_client\connect.py", line 547, in write_connection_file
    kernel_name=self.kernel_name
  File "C:\Users\User1\Anaconda3\Ana3\lib\site-packages\jupyter_client\connect.py", line 212, in write_connection_file
    with secure_write(fname) as f:
  File "C:\Users\User1\Anaconda3\Ana3\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "C:\Users\User1\Anaconda3\Ana3\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\\User1\\AppData\\Roaming\\jupyter\\runtime\\kernel-501ad49f-c5f7-4c1b-a521-e1b754281609.json'

解决办法:

在以“以管理员身份运行”身份运行Anaconda Navigator之后,内核可以正确启动。如果单独运行Jupyter,内核依旧不能启动,再次以“以管理员身份运行”身份运行Jupyter即可

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!