繁体   English   中英

在 Spyder 的 IPython 控制台中启动内核时出现 PermissionError

[英]PermissionError while starting the kernel in Spyder's IPython console

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

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 jupyter_client""conda update --all" )我也尝试安装和卸载,但我仍然得到同样的错误。

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

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

请注意,原始解决方法在这种情况下也有效。

对我有帮助的是允许不安全的写入:

yourPythonPath\scripts\activate.bat
set JUPYTER_ALLOW_INSECURE_WRITES=1
spyder

或者,您也可以在全局 Windows 环境变量中将 JUPYTER_ALLOW_INSECURE_WRITES 设置为 1。

暂无
暂无

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

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