简体   繁体   English

Jupyter Notebook 中的 Kernel 错误(Errno 13 Permission denied),Windows 10

[英]Kernel error (Errno 13 Permission denied) in Jupyter Notebook, Windows 10

I have installed Jupyter Notebook on Windows 10. I can execute jupyter notebook command.我已经在 Windows 10 上安装了 Jupyter Notebook。我可以执行 jupyter notebook 命令。 It opens and shows a list of current path directories.它打开并显示当前路径目录的列表。 I also can create or open a notebook.我还可以创建或打开一个笔记本。 But when I do it I get Kernel error in the top right corner.但是当我这样做时,我在右上角收到 Kernel 错误。 After clicking on it this window appears:单击它后,出现此 window:

Failed to start the kernel kernel启动失败

Unhandled error未处理的错误

Traceback (most recent call last):
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\web.py", line 1699, in _execute
    result = await result
  File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 383, in __iter__
    return self.result()  # May raise too.
  File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 294, in result
    raise self._exception
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
    type=mtype))
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 294, in result
    raise self._exception
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "c:\users\lola\appdata\local\programs\python\python35\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\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 294, in result
    raise self._exception
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "c:\users\lola\appdata\local\programs\python\python35\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\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 735, in run
    value = future.result()
  File "c:\users\lola\appdata\local\programs\python\python35\lib\asyncio\futures.py", line 294, in result
    raise self._exception
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\tornado\gen.py", line 209, in wrapper
    yielded = next(result)
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\jupyter_client\manager.py", line 240, in start_kernel
    self.write_connection_file()
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\jupyter_client\connect.py", line 547, in write_connection_file
    kernel_name=self.kernel_name
  File "c:\users\lola\appdata\local\programs\python\python35\lib\site-packages\jupyter_client\connect.py", line 212, in write_connection_file
    with secure_write(fname) as f:
  File "c:\users\lola\appdata\local\programs\python\python35\lib\contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "c:\users\lola\appdata\local\programs\python\python35\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\\Lola\\AppData\\Roaming\\jupyter\\runtime\\kernel-fd884f4e-8208-4b8e-9db2-c048f869e042.json'

The code in my file is not highlighted in different colors and when I run it nothing happens.我文件中的代码没有在不同的 colors 中突出显示,当我运行它时没有任何反应。

I am new to programming, so please try to give advice in simple words, describing each step in detail.我是编程新手,所以请尽量用简单的语言给出建议,详细描述每个步骤。

In the past, I've tried to delete Python, install Python in different versions, install Anaconda.过去我试过删除Python,安装不同版本的Python,安装Anaconda。 In addition, in order to work with tensorflow, I've created a special environment.此外,为了与 tensorflow 一起工作,我创建了一个特殊的环境。 But this error stays the same.但是这个错误保持不变。 I suspect the problem is a double backslash ("//") in the path, but I have absolutely no idea how to fix this.我怀疑问题是路径中的双反斜杠(“//”),但我完全不知道如何解决这个问题。 But perhaps the problem is something else.但也许问题出在别的地方。

Same exact problem here.同样的问题在这里。 What worked for me was running the Anaconda Navigator as an Administrator.对我有用的是以管理员身份运行 Anaconda Navigator。 Hope it works for you too.希望它也适合你。

This problems occurred since the last update of the jupyter_client.自上次更新 jupyter_client 以来出现此问题。 You can temporarily solve the issue by downgrading to the last version.您可以通过降级到最新版本来暂时解决问题。

conda install jupyter_client=5.3.1

Running as administrator solved it, great!!以管理员身份运行解决了,太好了!!

I have the same problem.我也有同样的问题。 I installed Anaconda on Windows 10/64 bit.我在 Windows 10/64 位上安装了 Anaconda。 Whenever I open Jupyter Notebook, I get Kernel Error每当我打开 Jupyter Notebook 时,我都会收到 Kernel 错误

Traceback (most recent call last):


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

And also opening Spyder, I get this error并且打开 Spyder,我得到了这个错误

An error ocurred while starting the kernel
The error is:

Traceback (most recent call last):
File "C:\Users\Odunsi\Anaconda3\lib\site‑packages\spyder\plugins\ipythonconsole.py", line 1572, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle)
File "C:\Users\Odunsi\Anaconda3\lib\site‑packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\Users\Odunsi\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\Odunsi\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\Users\Odunsi\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\Odunsi\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\\Odunsi\\AppData\\Roaming\\jupyter\\runtime\\kernel‑d91ab80cbf1f.json'

But opening as an administrator works fine.但是以管理员身份打开工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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