Python 为什么我在Jupyter笔记本中出现内核错误?

Python 为什么我在Jupyter笔记本中出现内核错误?,python,kernel,Python,Kernel,我是python的新手。在打开jupyter笔记本时,我在内核中遇到以下错误。有什么办法可以解决吗?jupyter的安装已经通过Anaconda3完成——尝试过重新安装和设置环境变量,但到目前为止运气不佳。任何帮助都将不胜感激 Traceback (most recent call last): File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\tornado\web.py", line 1699

我是python的新手。在打开jupyter笔记本时,我在内核中遇到以下错误。有什么办法可以解决吗?jupyter的安装已经通过Anaconda3完成——尝试过重新安装和设置环境变量,但到目前为止运气不佳。任何帮助都将不胜感激

 Traceback (most recent call last):
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\tornado\web.py", line 1699, in _execute
        result = await result
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\notebook\services\sessions\handlers.py", line 72, in post
        type=mtype))
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
        value = future.result()
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\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:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
        value = future.result()
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 742, in run
        yielded = self.gen.throw(*exc_info)  # type: ignore
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\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:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 735, in run
        value = future.result()
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\tornado\gen.py", line 209, in wrapper
        yielded = next(result)
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
        super(MappingKernelManager, self).start_kernel(**kwargs)
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
        km.start_kernel(**kwargs)
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\jupyter_client\manager.py", line 240, in start_kernel
        self.write_connection_file()
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 547, in write_connection_file
        kernel_name=self.kernel_name
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 212, in write_connection_file
        with secure_write(fname) as f:
      File "C:\Users\drag88\Anaconda3\lib\contextlib.py", line 112, in __enter__
        return next(self.gen)
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 100, in secure_write
        win32_restrict_file_to_user(fname)
      File "C:\Users\drag88\AppData\Roaming\Python\Python37\site-packages\jupyter_client\connect.py", line 53, in win32_restrict_file_to_user
        import win32api
    ImportError: DLL load failed: The specified procedure could not be found.

如果您的电脑上安装了Python,请从cmd或powershell运行:

pip install jupyterlab
然后,您可以从以下内容开始:

jupyter lab

如果您的电脑上安装了Python,请从cmd或powershell运行:

pip install jupyterlab
然后,您可以从以下内容开始:

jupyter lab

看起来您在jupyter对Windows的依赖性出现问题时安装了它。看见我也犯了同样的错误


现在应该在conda上修复它,因此如果您从conda卸载并重新安装jupyterlab,它将不再抛出该错误。

看起来您在jupyter对Windows的依赖性出现问题时安装了它。看见我也犯了同样的错误


现在应该在conda上修复它,因此如果您从conda卸载并重新安装jupyterlab,它将不会再抛出该错误。

安装可能错过了一些步骤,这些步骤是通过后期安装修复的。 转到YoutVenv的脚本目录并运行命令

python .\pywin32_postinstall.py -install

确保您正在运行具有管理员权限的shell。

安装可能遗漏了一些步骤,这些步骤已通过后期安装修复。 转到YoutVenv的脚本目录并运行命令

python .\pywin32_postinstall.py -install
确保您正在使用管理员权限运行shell。

  • 步骤2命令:
    conda activate(环境文件夹的位置)
  • 步骤3命令:
    python-mipykernel安装--user
适用于Windows。

  • 步骤2命令:
    conda activate(环境文件夹的位置)
  • 步骤3命令:
    python-mipykernel安装--user
适用于Windows