我的jupyter笔记本坏了,笔记本坏了

2024-05-20 01:32:54 发布

您现在位置:Python中文网/ 问答频道 /正文

(base) C:\Users\deves>conda install jupyter nb_conda ipykernel
Collecting package metadata (current_repodata.json): done
Solving environment: done

一揽子计划

环境位置:C:\Users\deves\anaconda3

新增/更新规格:

  • 伊皮克内尔
  • 朱皮特
  • nb_康达

将安装以下新软件包:

  nb_conda           pkgs/main/win-64::nb_conda-2.2.1-py38_1
  nb_conda_kernels   pkgs/main/win-64::nb_conda_kernels-2.3.1-py38haa95532_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: - Enabling nb_conda_kernels...
CONDA_PREFIX: C:\Users\deves\anaconda3
Status: enabled

| Config option `kernel_spec_manager_class` not recognized by `EnableNBExtensionApp`.
Enabling notebook extension nb_conda/main...
      - Validating: ok
Enabling tree extension nb_conda/tree...
      - Validating: ok
Config option `kernel_spec_manager_class` not recognized by `EnableServerExtensionApp`.
Enabling: nb_conda
- Writing config: C:\Users\deves\anaconda3\etc\jupyter
    - Validating...
      nb_conda 2.2.1 ok

done
ERROR conda.core.link:_execute(698): An error occurred while installing package 'defaults::nb_conda_kernels-2.3.1-py38haa95532_0'.
Rolling back transaction: done

LinkError: post-link script failed for package defaults::nb_conda_kernels-2.3.1-py38haa95532_0
location of failed script: C:\Users\deves\anaconda3\Scripts\.nb_conda_kernels-post-link.bat
==> script messages <==
Enabling nb_conda_kernels...
CONDA_PREFIX: C:\Users\deves\anaconda3
Status: enabled

==>;脚本输出<;==

stdout:
stderr: 'chcp' is not recognized as an internal or external command,
operable program or batch file.
'chcp' is not recognized as an internal or external command,
operable program or batch file.
'chcp' is not recognized as an internal or external command,
operable program or batch file.

return code: 1

()


(base) C:\Users\deves>

(base) C:\Users\deves>jupyter notebook
[C 12:05:35.041 NotebookApp] Bad config encountered during initialization: The 'kernel_spec_manager_class' trait of <notebook.notebookapp.NotebookApp object at 0x0000022CC9114F10> instance must be a type, but 'nb_conda_kernels.CondaKernelSpecManager' could not be imported.

请通过卸载和重新安装来帮助尝试了很多,但这不起作用


Tags: orpackagebasenotjupytercondauserstransaction
1条回答
网友
1楼 · 发布于 2024-05-20 01:32:54
  1. 您应该找到文件jupyter_config.json,其路径可能如下'C:\Users\mi.conda\envs\pytorch\u 1.7\u cpu\etc\jupyter',然后删除

     "kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
    

    如果存在,请删除它,包括上面的逗号

  2. 删除了以下三个文件夹(不过,您可能需要进行一些备份…)

    约皮特

    ~/.ipython

    ~/.local/share/jupyter

(这里我删除了除“kernels”子文件夹之外的所有内容)

  1. 我运行了以下4条指令:

    jupyter nbextension安装用户py widgetsnbextension

    jupyter nbextension安装用户py bqplot

    jupyter nbextension启用用户py widgetsnbextension

    jupyter nbextension启用用户py bqplot

相关问题 更多 >