启动ipython内核发生错误,在Spyder的IPython控制台中启动内核时出现PermissionError

Posted 真·空

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了启动ipython内核发生错误,在Spyder的IPython控制台中启动内核时出现PermissionError相关的知识,希望对你有一定的参考价值。

When I launch spyder, this error appears :

Traceback (most recent call last):

File "C:\\ProgramData\\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:\\ProgramData\\Anaconda3\\lib\\site‑packages\\jupyter_client\\manager.py", line 240, in start_kernel

self.write_connection_file()

File "C:\\ProgramData\\Anaconda3\\lib\\site‑packages\\jupyter_client\\connect.py", line 547, in write_connection_file

kernel_name=self.kernel_name

File "C:\\ProgramData\\Anaconda3\\lib\\site‑packages\\jupyter_client\\connect.py", line 212, in write_connection_file

with secure_write(fname) as f:

File "C:\\ProgramData\\Anaconda3\\lib\\contextlib.py", line 112, in __enter__

return next(self.gen)

File "C:\\ProgramData\\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\\\\Sébastien\\\\AppData\\\\Roaming\\\\jupyter\\\\runtime\\\\kernel‑e1f2b044843b.json'

I am not experienced at all in programming but I tried to enter commands in the Anaconda prompt but none of this worked ("conda update jupyter_client" and "conda update --all")

I also tried to install and uninstall but I still get the same error.

解决方案

This seems a permissions issue. Running Spyder as administrator (right click on it-> run as administrator) solves the problem.

UPDATE:

As per @CarlosCordoba: "To fix this the OP needs to run conda update anaconda and then conda update jupyter_client in the Anaconda Prompt"

Note that the original workaround worked as well in this case.

以上是关于启动ipython内核发生错误,在Spyder的IPython控制台中启动内核时出现PermissionError的主要内容,如果未能解决你的问题,请参考以下文章

Spyder - 启动内核时发生错误

为啥我在运行 Python 时在 Spyder 中收到“启动内核时发生错误”?

在 Spyder iPython 解释器中抑制 ipdb 输出

Spyder 5.1.5 在运行自定义函数后创建一个新内核 [重复]

Spyder 正在重新启动内核而没有错误消息

在 IPython 控制台中运行内核的问题