Jupyter hub shows python [conda root] and python [default ] as kernel names instead of python 3 #1716

Closed
aries89 opened this Issue Aug 26, 2016 · 19 comments

Projects

None yet

8 participants

@aries89
aries89 commented Aug 26, 2016

I did try uninstalling nb_conda_kernels, but then the spawner started failing with a bad request error.

I also tried
[root@jup-nr jupyteruser]# conda update nb_conda nb_conda_kernels nb_anacondacloud
Fetching package metadata .......

All requested packages already installed.

packages in environment at /opt/anaconda3:

nb_anacondacloud 1.2.0 py35_0
nb_conda 2.0.0 py35_0
nb_conda_kernels 2.0.0 py35_0

But I am still facing the same issue.

Can anyone please let me know the fix for this ?

@takluyver
Member
@damianavila
Contributor

Can you paste the output of conda list

How did you try to uninstall the conda packages?

Can you also provide the output of jupyter nbextension list and jupyter serverextension list

Thanks!

@aries89
aries89 commented Aug 29, 2016 edited

@damianavila

[root@jup-nr ~]# conda list

packages in environment at /opt/anaconda3:

_nb_ext_conf 0.3.0 py35_0
alabaster 0.7.7 py35_0
anaconda 4.0.0 np110py35_0
anaconda-client 1.4.0 py35_0
anaconda-navigator 1.1.0 py35_0
argcomplete 1.0.0 py35_1
astropy 1.1.2 np110py35_0
babel 2.2.0 py35_0
beautifulsoup4 4.4.1 py35_0
bitarray 0.8.1 py35_0
blaze 0.9.1 py35_0
bokeh 0.11.1 py35_0
boto 2.39.0 py35_0
bottleneck 1.0.0 np110py35_0
cffi 1.5.2 py35_0
chest 0.2.3 py35_0
cloudpickle 0.1.1 py35_0
clyent 1.2.1 py35_0
colorama 0.3.7 py35_0
conda 4.1.11 py35_0
conda-build 1.20.0 py35_0
conda-env 2.5.2 py35_0
conda-manager 0.3.1 py35_0
configobj 5.0.6 py35_0
cryptography 1.3 py35_0
curl 7.45.0 0
cycler 0.10.0 py35_0
cython 0.23.4 py35_0
cytoolz 0.7.5 py35_0
dask 0.8.1 py35_0
datashape 0.5.1 py35_0
decorator 4.0.9 py35_0
dill 0.2.4 py35_0
docutils 0.12 py35_0
dynd-python 0.7.2 py35_0
et_xmlfile 1.0.1 py35_0
fastcache 1.0.2 py35_0
flask 0.10.1 py35_1
flask-cors 2.1.2 py35_0
fontconfig 2.11.1 5
freetype 2.5.5 0
gevent 1.1.0 py35_0
greenlet 0.4.9 py35_0
h5py 2.5.0 np110py35_4
hdf5 1.8.15.1 2
heapdict 1.0.0 py35_0
ibm-db 2.0.7
idna 2.0 py35_0
insight-factory 0.1
ipykernel 4.3.1 py35_0
ipython 4.1.2 py35_1
ipython_genutils 0.1.0 py35_0
ipywidgets 4.1.1 py35_0
itsdangerous 0.24 py35_0
jbig 2.1 0
jdcal 1.2 py35_0
jedi 0.9.0 py35_0
jinja2 2.8 py35_0
jpeg 8d 0
jsonschema 2.4.0 py35_0
jupyter 1.0.0 py35_3
jupyter-kernel-gateway 1.0.0
jupyter_client 4.2.2 py35_0
jupyter_console 4.1.1 py35_0
jupyter_core 4.1.0 py35_0
jupyterhub 0.6.1
jupyterhub-ldapauthenticator 1.0
ldap3 1.4.0
libdynd 0.7.2 0
libffi 3.0.13 0
libgfortran 3.0 0
libpng 1.6.17 0
libsodium 1.0.3 0
libtiff 4.0.6 2
libxml2 2.9.2 0
libxslt 1.1.28 0
llvmlite 0.9.0 py35_0
locket 0.2.0 py35_0
lxml 3.6.0 py35_0
Markdown 2.6.6
markupsafe 0.23 py35_0
matplotlib 1.5.1 np110py35_0
mistune 0.7.2 py35_0
mkl 11.3.1 0
mkl-service 1.1.2 py35_0
mpmath 0.19 py35_0
multipledispatch 0.4.8 py35_0
nb_anacondacloud 1.2.0 py35_0
nb_conda 2.0.0 py35_0
nb_conda_kernels 2.0.0 py35_0
nbconvert 4.1.0 py35_0
nbformat 4.0.1 py35_0
nbpresent 3.0.2 py35_0
networkx 1.11 py35_0
nltk 3.2 py35_0
nose 1.3.7 py35_0
notebook 4.2.2 py35_0
numba 0.24.0 np110py35_0
numexpr 2.5 np110py35_0
numpy 1.10.4 py35_1
odo 0.4.2 py35_0
openpyxl 2.3.2 py35_0
openssl 1.0.2h 1
pamela 0.2.1
pandas 0.18.0 np110py35_0
pandasql 0.7.3
partd 0.3.2 py35_1
patchelf 0.8 0
path.py 8.1.2 py35_1
patsy 0.4.0 np110py35_0
pep8 1.7.0 py35_0
pexpect 4.0.1 py35_0
pickleshare 0.5 py35_0
pillow 3.1.1 py35_0
pip 8.1.2 py35_0
ply 3.8 py35_0
psutil 4.1.0 py35_0
ptyprocess 0.5 py35_0
py 1.4.31 py35_0
pyasn1 0.1.9 py35_0
pycosat 0.6.1 py35_0
pycparser 2.14 py35_0
pycrypto 2.6.1 py35_0
pycurl 7.19.5.3 py35_0
pyflakes 1.1.0 py35_0
pygments 2.1.1 py35_0
pyopenssl 0.15.1 py35_2
pyparsing 2.0.3 py35_0
pyqt 4.11.4 py35_1
pytables 3.2.2 np110py35_1
pytest 2.8.5 py35_0
python 3.5.2 0
python-dateutil 2.5.1 py35_0
pytz 2016.2 py35_0
pyyaml 3.11 py35_1
pyzmq 15.2.0 py35_0
qt 4.8.7 1
qtawesome 0.3.2 py35_0
qtconsole 4.2.0 py35_0
qtpy 1.0 py35_0
readline 6.2 2
redis 2.6.9 0
redis-py 2.10.3 py35_0
regex 2016.7.21
requests 2.9.1 py35_0
rope 0.9.4 py35_1
ruamel_yaml 0.11.14 py35_0
scikit-image 0.12.3 np110py35_0
scikit-learn 0.17.1 np110py35_0
scipy 0.17.0 np110py35_2
setuptools 25.1.6 py35_0
simplegeneric 0.8.1 py35_0
singledispatch 3.4.0.3 py35_0
sip 4.16.9 py35_0
six 1.10.0 py35_0
snowballstemmer 1.2.1 py35_0
sockjs-tornado 1.0.1 py35_0
sphinx 1.3.5 py35_0
sphinx_rtd_theme 0.1.9 py35_0
spyder 2.3.8 py35_1
sqlalchemy 1.0.12 py35_0
sqlite 3.13.0 0
statsmodels 0.6.1 np110py35_0
sympy 1.0 py35_0
terminado 0.5 py35_1
tk 8.5.18 0
toolz 0.7.4 py35_0
tornado 4.3 py35_0
traitlets 4.2.1 py35_0
unicodecsv 0.14.1 py35_0
util-linux 2.21 0
werkzeug 0.11.4 py35_0
wheel 0.29.0 py35_0
xlrd 0.9.4 py35_0
xlsxwriter 0.8.4 py35_0
xlwt 1.0.0 py35_0
xz 5.2.2 0
yaml 0.1.6 0
zeromq 4.1.3 0
zlib 1.2.8 3


[root@jup-nr ~]# jupyter nbextension list
Known nbextensions:
config dir: /root/.jupyter/nbconfig
notebook section
sidebar/main enabled
- Validating: OK
toc/main enabled
- Validating: OK
config/config_menu/main enabled
- Validating: OK
config dir: /opt/anaconda3/etc/jupyter/nbconfig
notebook section
nbpresent/js/nbpresent.min enabled
- Validating: OK
nb_conda/main enabled
- Validating: OK
nb_anacondacloud/main enabled
- Validating: OK
jupyter-js-widgets/extension enabled
- Validating: problems found:
- require? X jupyter-js-widgets/extension
tree section
nb_conda/tree enabled
- Validating: OK
[root@jup-nr ~]#


[root@jup-nr ~]# jupyter serverextension list
config dir: /opt/anaconda3/etc/jupyter
nbpresent enabled
- Validating...
nbpresent OK
nb_conda enabled
- Validating...
nb_conda OK
nb_anacondacloud enabled
- Validating...
nb_anacondacloud OK
[root@jup-nr ~]#

I used conda uninstall command.

@damianavila
Contributor

Let's try conda remove _nb_ext_conf (it will remove all the extensions but conda remove nb_conda should be the same because it removes all the extension bundle as well) and please post the output of jupyter nbextension list and jupyter serverextension list to see if they are disabled as expected.
Additionally the content of /opt/anaconda3/etc/jupyter/jupyter_notebook_config.json to see if nb_conda_kernel reference was removed.

Thanks!

@aries89
aries89 commented Aug 29, 2016

[root@jup-nr ~]# jupyter nbextension list
Known nbextensions:
config dir: /root/.jupyter/nbconfig
notebook section
config/config_menu/main enabled
- Validating: OK
toc/main enabled
- Validating: OK
sidebar/main enabled
- Validating: OK

[root@jup-nr ~]# jupyter serverextension list
[root@jup-nr ~]#

./opt/anaconda3/pkgs/_nb_ext_conf-0.3.0-py35_0/etc/jupyter/jupyter_notebook_config.json

{
"NotebookApp": {
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager",
"nbserver_extensions": {
"nb_conda": true,
"nb_anacondacloud": true,
"nbpresent": true
}
}
}

./opt/anaconda2/pkgs/_nb_ext_conf-0.3.0-py27_0/etc/jupyter/jupyter_notebook_config.json

{
"NotebookApp": {
"nbserver_extensions": {
"nbpresent": true,
"nb_conda": true,
"nb_anacondacloud": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
}

./opt/anaconda2/etc/jupyter/jupyter_notebook_config.json

{
"NotebookApp": {
"nbserver_extensions": {
"nbpresent": true,
"nb_conda": true,
"nb_anacondacloud": true
},
"kernel_spec_manager_class": "nb_conda_kernels.CondaKernelSpecManager"
}
}

@damianavila
Contributor

./opt/anaconda2/etc/jupyter/jupyter_notebook_config.json

Do you have anaconda2 installed alongside with anaconda3?

In any case, if you start jupyterhub in your anaconda3 env, I don't see how this could affect unless the Spawner is using notebook server from the anaconda2 env (although I did not play to much with jupyterhub yet and maybe I am missing something else).

What happens if you remove the extensions from the anaconda2 installation as well?

@jzf2101
jzf2101 commented Aug 29, 2016

I'm having similar issues from switching from python2 to python3

@damianavila
Contributor

I'm having similar issues from switching from python2 to python3

What do you mean? For instance you don't need anaconda2 to have python2 kernels... can you clarify how is your setup? Thanks!

@aries89
aries89 commented Aug 30, 2016

[root@jup-nr ~]# /opt/anaconda2/bin/jupyter nbextension list
Known nbextensions:
config dir: /root/.jupyter/nbconfig
notebook section
sidebar/main enabled
- Validating: OK
config/config_menu/main enabled
- Validating: OK
toc/main enabled
- Validating: OK
[root@jup-nr ~]# /opt/anaconda2/bin/jupyter serverextension list
[root@jup-nr ~]#

It works fine now. I can see the kernels as R, Python 2 and Python3.

So just to summarize

I would need to do the following to fix the issue right ?
/opt/anaconda2/bin/conda remove _nb_ext_conf
/opt/anaconda3/bin/conda remove _nb_ext_conf

Did I miss any step ?

@aries89
aries89 commented Aug 30, 2016

Does the remove command affect user defined jupyter notebook extensions ?

@damianavila
Contributor

Did I miss any step ?

I think you are OK now... interesting to see that you have both anaconda installed alongside... curious about the setup and why you put them together...

Does the remove command affect user defined jupyter notebook extensions ?

Removing _nb_ext_conf will remove the extensions provided by default by Anaconda but it should not affect other jupyter extensions defined by the user...

@aries89
aries89 commented Aug 31, 2016

Thanks.

Would I have to always run the remove command or in the next jupyter updates this issue would be fixed?

@damianavila
Contributor

Would I have to always run the remove command or in the next jupyter updates this issue would be fixed?

The Anaconda distribution is shipping some nbextensions by default. So anytime you use Anaconda, if you don't want those extension, you need to remove it.
But, just to be clear, this is something specific from Anaconda.
You can always have the native jupyter experience, creating new environments with just the notebook on it, removing the extensions as I mentioned before or using other alternatives installations as the Jupyter docs explain in details.

Cheers.

@gnestor gnestor added this to the not notebook milestone Sep 13, 2016
@laurikoobas

Just to follow up on this - the "conda remove _nb_ext_conf" command output is scary..

$ conda remove _nb_ext_conf
Fetching package metadata .......
Solving package specifications: ..........

Package plan for package removal in environment /opt/anaconda3:

The following packages will be REMOVED:

    _nb_ext_conf:     0.3.0-py35_0
    anaconda:         4.2.0-np111py35_0
    ipywidgets:       5.2.2-py35_0
    jupyter:          1.0.0-py35_3
    nb_anacondacloud: 1.2.0-py35_0
    nb_conda:         2.0.0-py35_0
    nb_conda_kernels: 2.0.0-py35_0
    nbpresent:        3.0.2-py35_0

It seems like removing jupyter and ipywidgets and.. anaconda itself(?) would have a detrimental effect on the whole jupyter notebook experience.

@takluyver
Member

I remember being confused by similar things. jupyter and anconda are metapackages: they contain no (or very little) code themselves, but they depend on a lot of other packages, so you can conveniently install a bunch of things by doing conda install jupyter. So removing them is not actually as big a problem as it sounds.

@damianavila
Contributor

@laurikoobas see my comment here: #1805 (comment)

@damianavila
Contributor

@takluyver, I think this can be closed, the thread have enough information for anyone hitting the same issue/question. Thanks!

@minrk minrk closed this Oct 13, 2016
@diego898
Contributor

Maybe I missed something, but I just have anaconda3 installed, and still see two kernel entries for conda root, and default as opposed to just python 3. I can't seem to parse here or on #1805

  1. why this is the case (seems to be 'an extension'?) and
  2. how to prevent it on a new install? I teach a lot of new users with ipython+anaconda and this is another major source of confusion.
  3. how to correct it on an existing install, without removing all extensions?
@damianavila
Contributor

why this is the case (seems to be 'an extension'?) and

Yes, it is the nb_conda_kernels extension that provide kernelspec on the fly for your conda envs: https://docs.continuum.io/anaconda/jupyter-notebook-extensions#notebook-conda-kernels

how to prevent it on a new install? I teach a lot of new users with ipython+anaconda and this is another major source of confusion.

This is shipped by default with Anaconda, you can create one environment with the plain jupyter to have the native experience, or alternative, remove the extension from your root environment with conda remove nb_conda_kernels. Notice this will also remove other extension provided with Anaconda and listed here: https://docs.continuum.io/anaconda/jupyter-notebook-extensions#

how to correct it on an existing install, without removing all extensions?

You can disabling instead of removing the extension, see this link: https://docs.continuum.io/anaconda/jupyter-notebook-extensions#uninstall (check the second paragraph, not the removal of nb_conda).

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment