2

Jupyter Notebook 正在运行,我可以打开一个 python3 笔记本。但我收到这个内核错误。这似乎是一个权限问题。但我不确定从哪里开始寻找。任何提示如何进行?

Traceback (most recent call last):
      File "c:\programdata\miniconda3\lib\site-packages\tornado\web.py", line 1699, in _execute
        result = await result
      File "c:\programdata\miniconda3\lib\site-packages\tornado\gen.py", line 742, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "c:\programdata\miniconda3\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
        type=mtype))
      File "c:\programdata\miniconda3\lib\site-packages\tornado\gen.py", line 735, in run
        value = future.result()
      File "c:\programdata\miniconda3\lib\site-packages\tornado\gen.py", line 742, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "c:\programdata\miniconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
        kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
      File "c:\programdata\miniconda3\lib\site-packages\tornado\gen.py", line 735, in run
        value = future.result()
      File "c:\programdata\miniconda3\lib\site-packages\tornado\gen.py", line 742, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "c:\programdata\miniconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session
        self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
      File "c:\programdata\miniconda3\lib\site-packages\tornado\gen.py", line 735, in run
        value = future.result()
      File "c:\programdata\miniconda3\lib\site-packages\tornado\gen.py", line 209, in wrapper
        yielded = next(result)
      File "c:\programdata\miniconda3\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
        super(MappingKernelManager, self).start_kernel(**kwargs)
      File "c:\programdata\miniconda3\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
        km.start_kernel(**kwargs)
      File "c:\programdata\miniconda3\lib\site-packages\jupyter_client\manager.py", line 240, in start_kernel
        self.write_connection_file()
      File "c:\programdata\miniconda3\lib\site-packages\jupyter_client\connect.py", line 476, in write_connection_file
        kernel_name=self.kernel_name
      File "c:\programdata\miniconda3\lib\site-packages\jupyter_client\connect.py", line 141, in write_connection_file
        with secure_write(fname) as f:
      File "c:\programdata\miniconda3\lib\contextlib.py", line 112, in __enter__
        return next(self.gen)
      File "c:\programdata\miniconda3\lib\site-packages\jupyter_core\paths.py", line 424, in secure_write
        win32_restrict_file_to_user(fname)
      File "c:\programdata\miniconda3\lib\site-packages\jupyter_core\paths.py", line 375, in win32_restrict_file_to_user
        win32security.SetFileSecurity(fname, win32security.DACL_SECURITY_INFORMATION, sd)
    pywintypes.error: (5, 'SetFileSecurity', 'Zugriff verweigert')
4

1 回答 1

0

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

yourPythonPath\scripts\activate.bat
set JUPYTER_ALLOW_INSECURE_WRITES=1
jupyter-notebook

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

于 2021-03-25T16:17:40.297 回答