请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

jupyter kernel error 运行不了python代码, 报了一个PermissionError

错误如下

Traceback (most recent call last):
  File "D:ProgramsAnaconda3libsite-packages	ornadoweb.py", line 1699, in _execute
    result = await result
  File "D:ProgramsAnaconda3libsite-packages	ornadogen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "D:ProgramsAnaconda3libsite-packages
otebookservicessessionshandlers.py", line 72, in post
    type=mtype))
  File "D:ProgramsAnaconda3libsite-packages	ornadogen.py", line 735, in run
    value = future.result()
  File "D:ProgramsAnaconda3libsite-packages	ornadogen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "D:ProgramsAnaconda3libsite-packages
otebookservicessessionssessionmanager.py", line 88, in create_session
    kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
  File "D:ProgramsAnaconda3libsite-packages	ornadogen.py", line 735, in run
    value = future.result()
  File "D:ProgramsAnaconda3libsite-packages	ornadogen.py", line 742, in run
    yielded = self.gen.throw(*exc_info)  # type: ignore
  File "D:ProgramsAnaconda3libsite-packages
otebookservicessessionssessionmanager.py", line 101, in start_kernel_for_session
    self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
  File "D:ProgramsAnaconda3libsite-packages	ornadogen.py", line 735, in run
    value = future.result()
  File "D:ProgramsAnaconda3libsite-packages	ornadogen.py", line 209, in wrapper
    yielded = next(result)
  File "D:ProgramsAnaconda3libsite-packages
otebookserviceskernelskernelmanager.py", line 168, in start_kernel
    super(MappingKernelManager, self).start_kernel(**kwargs)
  File "D:ProgramsAnaconda3libsite-packagesjupyter_clientmultikernelmanager.py", line 110, in start_kernel
    km.start_kernel(**kwargs)
  File "D:ProgramsAnaconda3libsite-packagesjupyter_clientmanager.py", line 240, in start_kernel
    self.write_connection_file()
  File "D:ProgramsAnaconda3libsite-packagesjupyter_clientconnect.py", line 547, in write_connection_file
    kernel_name=self.kernel_name
  File "D:ProgramsAnaconda3libsite-packagesjupyter_clientconnect.py", line 212, in write_connection_file
    with secure_write(fname) as f:
  File "D:ProgramsAnaconda3libcontextlib.py", line 112, in __enter__
    return next(self.gen)
  File "D:ProgramsAnaconda3libsite-packagesjupyter_clientconnect.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\liusuizhu\AppData\Roaming\jupyter\runtime\kernel-eb5ae40f-7203-439e-8702-9580a92f32a7.json'

我到C:UsersliusuizhuAppDataRoamingjupyter untime这个目录下找到图片描述

照片中Group or user names的解析SID不是正确的

正在回答 回答被采纳积分+3

3回答

liuyubobobo 2019-11-21 14:30:50

额?给官方 github 提 issue 了,看看官方怎么回答吧。这种问题我也解决不了。。。


加油!:)

0 回复 有任何疑惑可以回复我~
  • 提问者 JohnLiu_ #1
    老师根据官方的issues,我修复了
    1. 删除C:\Users\liusuizhu\AppData\Roaming\jupyter\runtime\目录下所有文件
    2. 编辑 C:\anaconda3\Lib\site-packages\jupyter_client\connect.py文件
    3. 替换connect.py文件下line 59 
    删除:user, _domain, _type = win32security.LookupAccountName("", win32api.GetUserName())之后
    再增加user, _domain, _type = win32security.LookupAccountName("", win32api.GetUserNameEx(win32api.NameSamCompatible))
    4. 删除编译好的 python file (C:\anaconda3\Lib\site-packages\jupyter_client\__pycache__\connect.cpython-XX.pyc)
    回复 有任何疑惑可以回复我~ 2019-11-21 14:54:26
  • liuyubobobo 回复 提问者 JohnLiu_ #2
    赞!继续加油!:)
    回复 有任何疑惑可以回复我~ 2019-11-21 15:00:39
提问者 JohnLiu_ 2019-11-21 14:29:12
提问者 JohnLiu_ 2019-11-21 14:25:46

https://github.com/jupyter/notebook/issues/4907#issuecomment-536190872

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信