Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad config encountered during initialization: #2875

Open
foreignsand opened this issue Sep 28, 2017 · 15 comments
Open

Bad config encountered during initialization: #2875

foreignsand opened this issue Sep 28, 2017 · 15 comments

Comments

@foreignsand
Copy link

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

@blink1073
Copy link
Contributor

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?

@foreignsand
Copy link
Author

foreignsand commented Oct 2, 2017

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!

@blink1073
Copy link
Contributor

@bollwyvl, @damianavila, thoughts on the above?

@damianavila
Copy link
Member

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

@gayathry2612
Copy link

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

@tobycheese
Copy link

@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.

@ltrottier
Copy link

Removing ~/.jupyter fixed it for me.

@turkialjrees
Copy link

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

@magg1ee
Copy link

magg1ee commented Jun 4, 2020

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

@wzl1368611
Copy link

Removing ~/.jupyter fixed it for me.

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

@harshith7823
Copy link

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

@PaulKGrimes
Copy link

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.

@abraham4671
Copy link

abraham4671 commented Sep 12, 2023

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

@kiranzo
Copy link

kiranzo commented Jan 26, 2024

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

@JPapir
Copy link

JPapir commented Aug 25, 2024

As other people noted, deleting the ~/.jupyter folder can help. However, the config folder is not necessarily in the home. To find out the configuration currently used, you should run:

jupyter-lab --debug

It will return the list of possible config files, and tell you which file is loaded. In my case :

[D 2024-08-25 23:03:27.378 ServerApp] Loaded config file: /home/XXXX/miniforge3/etc/jupyter/jupyter_config.json

Then, simply delete the appropriate config file, according to the output, and you should be able to reset the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests