anaconda / nb_conda_kernels

Package for managing conda environment-based kernels inside of Jupyter
BSD 3-Clause "New" or "Revised" License
601 stars 70 forks source link

"Bad config encountered during initialization" in launching Jupyter-lab after unsuccessful installation of nb_conda_kernels #219

Closed Beckinetic closed 8 months ago

Beckinetic commented 2 years ago

Hi, when I tried installing nb_conda_kernels using conda install nb_conda_kernels, I got the following outputs:

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\tsoze\anaconda3\envs\py310

  added / updated specs:
    - nb_conda_kernels

The following NEW packages will be INSTALLED:

  nb_conda_kernels   anaconda/cloud/conda-forge/win-64::nb_conda_kernels-2.3.1-py310h5588dad_1

Proceed ([y]/n)? y

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

done
ERROR conda.core.link:_execute(730): An error occurred while installing package 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge::nb_conda_kernels-2.3.1-py310h5588dad_1'.
Rolling back transaction: done

LinkError: post-link script failed for package https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge::nb_conda_kernels-2.3.1-py310h5588dad_1
location of failed script: C:\Users\tsoze\anaconda3\envs\py310\Scripts\.nb_conda_kernels-post-link.bat
==> script messages <==
Enabling nb_conda_kernels...
CONDA_PREFIX: C:\Users\tsoze\anaconda3\envs\py310
Status: enabled

==> script output <==
stdout:
stderr: 'chcp' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
'chcp' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
'chcp' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���

return code: 1

()

and after that I tried to launch Jupyter-lab, and I got feedbacks as '[C 2022-04-26 18:08:43.283 ServerApp] Bad config encountered during initialization: The 'kernel_spec_manager_class' trait of <jupyter_server.serverapp.ServerApp object at 0x00000221448BEA70> instance must be a type, but 'nb_conda_kernels.CondaKernelSpecManager' could not be imported'

I thought such problems were caused by the unsuccessful installation of this plugin. I wonder if there is any way to install it correctly, or to remove the alternations it made when installing so I can use Jupyter-lab as before?

My conda version is 4.12.0, and python version 3.10.4. My OS is Windows 10.

Many thanks. Beck

knaaptime commented 2 years ago

I was running into this same issue installing on a new machine. Was able to resolve it by making sure the jupyter_config.json file was present

mcg1969 commented 8 months ago

I'm sorry we didn't respond to this at the time. I will be closing this as stale but if we can reproduce this on a more modern stack (e.g., new conda, new jupyter, etc.) then we can re-open.