notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Bad config encountered during initialization:

Open foreignsand opened this issue 7 years ago • 15 comments

When I try to launch Jupiter Notebook from the command line or from Anaconda Navigator I get the following error:

[C 13:09:45.091 NotebookApp] Bad config encountered during initialization: [C 13:09:45.104 NotebookApp] The 'kernel_spec_manager_class' trait of <notebook.notebookapp.NotebookApp object at 0x101ca3278> instance must be a type, but 'nb_conda_kernels.CondaKernelSpecManager' could not be imported

I can run Jupiter Notebook from other Python environments but not from root. I would really like to just be able to launch the notebook using the default version of Python on my machine. Currently this is 3.6.2.

Many thanks, Emily

foreignsand avatar Sep 28 '17 20:09 foreignsand

Hi Emily,

It sounds like you have nb_conda_kernels enabled but not installed in the root environment. Can you give the output of jupyter serverextension list and conda list nb_conda_kernels from the root environment?

blink1073 avatar Sep 28 '17 20:09 blink1073

Sure thing. Here they are:

$ jupyter serverextension list
config dir: /Users/lemurbear/anaconda/etc/jupyter
    nb_anacondacloud  enabled 
    - Validating...
Error loading server extension nb_anacondacloud
      X is nb_anacondacloud importable?
    nb_conda  enabled 
    - Validating...
Error loading server extension nb_conda
      X is nb_conda importable?
    nbpresent  enabled 
    - Validating...
Error loading server extension nbpresent
      X is nbpresent importable?
$ conda list nb_conda_kernels
# packages in environment at /Users/lemurbear/anaconda:
#
nb_conda_kernels          2.0.0                    py35_0

Thanks!

foreignsand avatar Oct 02 '17 08:10 foreignsand

@bollwyvl, @damianavila, thoughts on the above?

blink1073 avatar Oct 02 '17 15:10 blink1073

What is the content of this file? /Users/lemurbear/anaconda/etc/jupyter/jupyter_notebook_config.json

damianavila avatar Oct 03 '17 15:10 damianavila

I encountered this error : Please share any information on how to resolve this. Thanks

[C 12:18:07.611 NotebookApp] Bad config encountered during initialization:
[C 12:18:07.612 NotebookApp] The 'contents_manager_class' trait of <notebook.notebookapp.NotebookApp object at 0x10a35d750> instance must be a type, but u'jupyterdrive.mixednbmanager.MixedContentsManager' could not be imported

gayathry2612 avatar Jun 03 '18 06:06 gayathry2612

@gayathry2612: For what it's worth, I just encountered this error after an upgrade. To fix it, I removed my ~/.jupyter config directory, reinstalled all jupyter-related packages with

pip list|grep jupyter|cut -f 1 -d ' ' | xargs pip install -U --force-reinstall

and reenabled the one extension I had installed:

jupyter nbextensions_configurator enable --user (I also have Rise installed, but it does not need to be enabled)

You'll also have to reapply any customisations you've made to the config files, but I didn't have any.

tobycheese avatar Oct 10 '18 09:10 tobycheese

Removing ~/.jupyter fixed it for me.

ltrottier avatar Mar 08 '19 17:03 ltrottier

This is might Help I SOLVED and wrote about it here

There is sometimes that the jupyter_notebook_config.py is missing To create a jupyter_notebook_config.py file, after installing the python , you can use the following command line: jupyter notebook --generate-config then run : jupyter notebook --config=/home/john/mystuff/jupyter_notebook_config.json

turkialjrees avatar Aug 20 '19 00:08 turkialjrees

When I try to launch Jupiter Notebook from the command line or from Anaconda Navigator I get the following error:

[C 13:09:45.091 NotebookApp] Bad config encountered during initialization: [C 13:09:45.104 NotebookApp] The 'kernel_spec_manager_class' trait of <notebook.notebookapp.NotebookApp object at 0x101ca3278> instance must be a type, but 'nb_conda_kernels.CondaKernelSpecManager' could not be imported

I can run Jupiter Notebook from other Python environments but not from root. I would really like to just be able to launch the notebook using the default version of Python on my machine. Currently this is 3.6.2.

Many thanks, Emily find this #c.NotebookApp.kernel_spec_manager_class = 'jupyter_client.kernelspec.KernelSpecManager' and delete # then words

magg1ee avatar Jun 04 '20 08:06 magg1ee

Removing ~/.jupyter fixed it for me.

the file is bad,it is a little problem,so easy,thanks!

wzl1368611 avatar Aug 28 '20 02:08 wzl1368611

Removing ~/.jupyter did not fix the issue for me

harshith7823 avatar Jun 20 '21 12:06 harshith7823

This can also occur if you have extensions installed in your global jupyter lab/notebook configuration, but not the underlying python packages installed in your Conda environment.

In my case, it was jupyter-fs messing things up, which saves a configuration .json in .jupyter, and tries to read it. But without the jupyter-fs Python package, it causes this error on start-up.

PaulKGrimes avatar Feb 06 '23 16:02 PaulKGrimes

I was learning and practicing anaconda on cloud and this happened

Bad config encountered during initialization: The 'kernel_spec_manager_class' trait of <notebook.notebookapp.NotebookApp object at 0x7f238ef2e290> instance must be a type, but 'nb_conda_kernels.CondaKernelSpecManager' could not be imported

abraham4671 avatar Sep 12 '23 15:09 abraham4671

I am trying to run miniconda of virtual Ubuntu server and access Jupyter notebook remotely, and I'm also having this error.

What should my exact steps be to install and run Jupyter on miniconda?

UPD Worked for me after I recreated my working environment and did conda install jupyter

kiranzo avatar Jan 26 '24 03:01 kiranzo