1

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.

Carlos Cordoba
  • 33,273
  • 10
  • 95
  • 124
Seb
  • 13
  • 4
  • This seems a permissions issue. Can you execute Anaconda-Navigator (I'm assuming that's what you're using) as Administrator by right clicking on the Icon and run as Administrator? I'd also try to give full access to your user to this folder and its children `C:\Users\Sébastien\` – the_ccalderon Dec 26 '19 at 18:37
  • I can run Anaconda-Navigator as an admnistrator, but I'm not using it. I only want to use spyder to program on it. It also seems that my folder has full acess. – Seb Dec 26 '19 at 18:45
  • Did you try running Spyder as an administrator then? If so, did you face the same error? – the_ccalderon Dec 26 '19 at 18:54
  • I just tried and the error is not showing anymore ! – Seb Dec 26 '19 at 18:55
  • Awesome, please confirm the answer below so new users can benefit from it. – the_ccalderon Dec 26 '19 at 18:58
  • Does this answer your question? [Kernel error (Errno 13 Permission denied) in Jupyter Notebook, Windows 10](https://stackoverflow.com/questions/58174067/kernel-error-errno-13-permission-denied-in-jupyter-notebook-windows-10) – Tsyvarev Dec 26 '19 at 19:29
  • It's abnormal and dysfunctional to need admin access for a data file in one's own profile directory -- i.e. "%AppData%\jupyter\runtime\kernel‑e1f2b044843b.json" -- if it's the case that the user's `Appdata` directory is "'C:\Users\Sébastien\AppData\Roaming". – Eryk Sun Dec 27 '19 at 02:48

2 Answers2

1

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.

the_ccalderon
  • 2,006
  • 2
  • 13
  • 24
  • 2
    (*Spyder maintainer here*) This is wrong. To fix this the OP needs to run `conda update anaconda` and then `conda update jupyter_client` in the Anaconda Prompt. – Carlos Cordoba Dec 27 '19 at 00:52
  • I just tried to run those commands in the Anaconda Prompt, but Spyder still shows the error. Also, after I runned the two commands, the Anaconda Prompt shows a long text wich contains : "InvalidArchiveError". – Seb Dec 28 '19 at 15:29
0

What did help for me was to allow insecure writes:

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

Alternatively you could also set JUPYTER_ALLOW_INSECURE_WRITES to 1 in your global Windows environment variables.

Robert
  • 1,357
  • 15
  • 26