der的IPython控制台中启动内核时出现Permission

der的IPython控制台中启动内核时出现Permission

本文介绍了在Spyder的IPython控制台中启动内核时出现PermissionError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我启动spyder时,出现此错误:

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'

我完全没有编程经验,但是我尝试在Anaconda提示符下输入命令,但是这些都不起作用("conda update jupyter_client""conda update --all")我也尝试安装和卸载,但仍然出现相同的错误.

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.

推荐答案

这似乎是权限问题.以管理员身份运行Spyder(右键单击它->以管理员身份运行)可以解决此问题.

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

更新:根据@CarlosCordoba:要解决此问题,OP需要在Anaconda Prompt中运行conda update anaconda,然后运行conda update jupyter_client"

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.

这篇关于在Spyder的IPython控制台中启动内核时出现PermissionError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 14:17