Jupyter_contrib_nbextensions: Installation on Ubuntu 16.04 failed

Created on 2 Aug 2016  路  10Comments  路  Source: ipython-contrib/jupyter_contrib_nbextensions

Hello,

I remember that some time ago I tried to install the nbextensions on my Ubuntu 16.04 and it failed. Now I want to retry it but it seems that I cannot. First of all I tried to remove the old installation by

pip uninstall jupyter_contrib_nbextensions

It seems to work but I can still access the http://localhost:8888/nbextensions page.

When I now try to follow the installation instructions, I do

git clone https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git jupyter_contrib_nbextensions

Cloning into 'jupyter_contrib_nbextensions'...
remote: Counting objects: 6143, done.
remote: Total 6143 (delta 0), reused 0 (delta 0), pack-reused 6142
Receiving objects: 100% (6143/6143), 21.10 MiB | 1.49 MiB/s, done.
Resolving deltas: 100% (3736/3736), done.
Checking connectivity... done.

pip install -e jupyter_contrib_nbextensions

[...]
Running setup.py develop for jupyter-contrib-nbextensions
Successfully installed MarkupSafe-0.23 backports-abc-0.4 backports.shutil-get-terminal-size-1.0.0 certifi-14.5.14 configparser-3.5.0 decorator-4.0.10 entrypoints-0.2.2 functools32-3.2.3.post2 ipykernel-4.3.1 ipython-5.0.0 ipython-genutils-0.1.0 jinja2-2.8 jsonschema-2.5.1 jupyter-client-4.3.0 jupyter-contrib-core-0.2.0 jupyter-contrib-nbextensions jupyter-core-4.1.0 jupyter-nbextensions-configurator-0.2.1 mistune-0.7.2 nbconvert-4.2.0 nbformat-4.0.1 notebook-4.2.1 pathlib2-2.1.0 pexpect-4.1.0 pickleshare-0.7.3 prompt-toolkit-1.0.3 psutil-4.3.0 ptyprocess-0.5.1 pygments-2.1.3 pyyaml-3.11 pyzmq-15.3.0 setuptools-24.0.2 simplegeneric-0.8.1 singledispatch-3.4.0.3 six-1.9.0 terminado-0.6 tornado-4.3 traitlets-4.2.2 wcwidth-0.1.7
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

jupyter contrib nbextension install --user

[...]
[C 22:03:16.226 NotebookApp] Bad config encountered during initialization:
[C 22:03:16.226 NotebookApp] Unrecognized flag: '--user'

The last command provokes some problems apparently. Can someone please help me and tell me what I am doing wrong?

Best regards.

install

Most helpful comment

Ok, so I found a cumbersome solution.
First of all, I had to completely uninstall jupyter.
And this is where things get funny... At least on my side it all boils down to an amazing inability to properly remove jupyter from the system (check stackoverflow and other searches...). It simply does not go away. Jupyter homepage has no documentation for uninstall either.
It does not matter if you try using pip/pip2/pip3 and/or apt-get to remove/uninstall it. It will say it uninstalled it, but if you type

$jupyter notebook

Voila! jupyter notebook you get... yeah.

So, what I did was manualy remove all jupyter folders and bins from the system
First of all, locate jupyter to find all of its instances. Then rm -ir [path to jupyter folders] and rm -i [path to jupyter bins] .
This will include paths like

/usr/etc/jupyter
/usr/local/bin/jupyter
/usr/local/bin/jupyter-console
/usr/local/bin/jupyter-contrib
/usr/local/bin/jupyter-kernelspec
/usr/local/bin/jupyter-migrate
/usr/local/bin/jupyter-nbconvert
/usr/local/bin/jupyter-nbextension
/usr/local/bin/jupyter-nbextensions_configurator
/usr/local/bin/jupyter-notebook
/usr/local/bin/jupyter-qtconsole
/usr/local/bin/jupyter-serverextension
/usr/local/bin/jupyter-troubleshoot
/usr/local/bin/jupyter-trust
/usr/local/lib/python3.4/dist-packages/jupyter-1.0.0.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter.py
/usr/local/lib/python3.4/dist-packages/jupyter_client
/usr/local/lib/python3.4/dist-packages/jupyter_client-4.4.0.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter_console
/usr/local/lib/python3.4/dist-packages/jupyter_console-5.0.0.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter_contrib_core
/usr/local/lib/python3.4/dist-packages/jupyter_contrib_core-0.3.0.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter_core
/usr/local/lib/python3.4/dist-packages/jupyter_core-4.1.1.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter_nbextensions_configurator
/usr/local/lib/python3.4/dist-packages/jupyter_nbextensions_configurator-0.2.2.dist-info

Just to be sure nothing got left behind, update locate's database and run locate jupyter again:

$ sudo updatedb
$ sudo locate jupyter

Once you're sure everything is gone, install with your favourite method (pip/anaconda/...).
In my case, I also had to install notebook, otherwise jupyter would complain that notebook was not a Jupyter command. So:

$ sudo pip3 install jupyter
$ sudo pip3 install notebook

Finally, remove and reinstall nbextensions.

All 10 comments

The installation procedure seems correct, but it seems that it is not the correct utility that is called. The error message should come from [InstallContribNbextensionsApp], not from [NotebookApp].
Can you check if jupyter-contrib-nbextension can be called on the command line (this script is in jupyter_contrib_nbextension/scripts)?

Hi, thanks for your reply.
I cannot run the command you asked for:

jupyter-contrib-nbextension: command not found

In order to make sure, my previous installation attempts are not interfering with my new attempts, I would like to fully remove the nbextensions and then start from scratch. What would be the right way to do so?

Hi @SvenBo90, sorry to hear it's causing problems for you.

some time ago I tried to install the nbextensions

How long ago was this? We've recently (within the last week) restructured the repository and package quite a bit, in the process of which we've switched to the new package name jupyter_contrib_nbextensions. This means that if your previous install attempt was before about July 27, it would have had the old package name.

It seems to work but I can still access the http://localhost:8888/nbextensions page.

Yes, this is (I expect) because the old version of the install procedure relied on copying files to the jupyter data directory, so unless you explicitly removed them, they'll still be there. The new version has a command for migrating from a previous install (jupyter contrib nbextensions migrate), and that's probably the best way to go for you. However, as @jfbercher says, it seems from your

$ jupyter contrib nbextension install --user
[...]
[C 22:03:16.226 NotebookApp] Bad config encountered during initialization:
[C 22:03:16.226 NotebookApp] Unrecognized flag: '--user'

that for some reason I don't understand, the notebook app is being called, rather than the intended jupyter-contrib or jupyter-contrib-nbextensions. Is jupyter-contrib on your path?

In order to make sure, my previous installation attempts are not interfering with my new attempts, I would like to fully remove the nbextensions and then start from scratch. What would be the right way to do so?

Depends a little on when your previous install attempt was. If you can see a file named ipython-contrib-IPython-notebook-extensions-installed_files.txt in the directory given by jupyter --data-dir, then you should be able to use the jupyter contrib nbextensions migrate command to remove all the files from the previous install. If the installed_files list isn't present, you'll need to do it manually, _as well as_ running the migrate command. To manually remove the files from bash, you can:

rm -r $(jupyter --data-dir)/usability
rm -r $(jupyter --data-dir)/styling
rm -r $(jupyter --data-dir)/publishing
rm -r $(jupyter --data-dir)/codemirrormode
rm -r $(jupyter --data-dir)/testing
rm -r $(jupyter --data-dir)/templates
rm -r $(jupyter --data-dir)/extensions

This should hopefully not kill anything else (which would hopefullybe indifferent directories), but exercise caution.

To perform an editable install of the new version from scratch, migrating from the old, use:

pip uninstall jupyter_contrib_nbextensionsa
git clone git clone https://github.com/ipython-contrib/jupyter_contrib_nbextensions.git
git pull
pip install -e ./jupyter_contrib_nbextensions
jupyter contrib nbextensions migrate
jupyter contrib nbextensions install --user

@SvenBo90 @jcb91
I suspect that the pip install -e should be performed as root (or with --user flag) ; as well as the pip uninstall. So here, it might be

sudo pip install -e ./jupyter_contrib_nbextensions

on the 4th line.

should be performed as root

depends which pip is being used, but if it needs sudo and you don't provide it, then it should complain loudly and fail. Should be pretty obvious, hopefully

@SvenBo90 did you manage to fix this in the end?

Dear all,

I have exactly the same problem here. I've tried the above suggestions, to no avail...
In fact, the suggested folders in jupyter --data-dir weren't even found, but anyways.
This is all I have there:

$ ls $(jupyter --data-dir)
nbextensions  nbsignatures.db  notebook_cookie_secret  notebook_secret

I've tried pip3 removing, repo downloading and installing, ... but when I got to the part of trying

jupyter contrib nbextensions migrate
jupyter contrib nbextensions install --user

Thinks didn't work out...
From the first one, I got:

$ jupyter contrib nbextensions migrate
community-contributed spice for Jupyter Interactive Computing

Options
-------

Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.

--debug
    set log level to logging.DEBUG (maximize logging output)
-y
    Answer yes to any questions instead of prompting.
--generate-config
    generate default config file
--config=<Unicode> (JupyterApp.config_file)
    Default: u''
    Full path of a config file.
--log-level=<Enum> (Application.log_level)
    Default: 30
    Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
    Set the log level by value or name.

To see all available configurables, use `--help-all`

Please supply at least one subcommand: 

For the installation it's pretty much the same thing, with the additional info of who is being called (as already mentioned in this thread):

$ jupyter contrib nbextensions install --user
community-contributed spice for Jupyter Interactive Computing

Options
-------

Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.

--debug
    set log level to logging.DEBUG (maximize logging output)
-y
    Answer yes to any questions instead of prompting.
--generate-config
    generate default config file
--config=<Unicode> (JupyterApp.config_file)
    Default: u''
    Full path of a config file.
--log-level=<Enum> (Application.log_level)
    Default: 30
    Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
    Set the log level by value or name.

To see all available configurables, use `--help-all`

[JupyterContribApp] CRITICAL | Bad config encountered during initialization:
[JupyterContribApp] CRITICAL | Unrecognized flag: '--user'

Ok, so I found a cumbersome solution.
First of all, I had to completely uninstall jupyter.
And this is where things get funny... At least on my side it all boils down to an amazing inability to properly remove jupyter from the system (check stackoverflow and other searches...). It simply does not go away. Jupyter homepage has no documentation for uninstall either.
It does not matter if you try using pip/pip2/pip3 and/or apt-get to remove/uninstall it. It will say it uninstalled it, but if you type

$jupyter notebook

Voila! jupyter notebook you get... yeah.

So, what I did was manualy remove all jupyter folders and bins from the system
First of all, locate jupyter to find all of its instances. Then rm -ir [path to jupyter folders] and rm -i [path to jupyter bins] .
This will include paths like

/usr/etc/jupyter
/usr/local/bin/jupyter
/usr/local/bin/jupyter-console
/usr/local/bin/jupyter-contrib
/usr/local/bin/jupyter-kernelspec
/usr/local/bin/jupyter-migrate
/usr/local/bin/jupyter-nbconvert
/usr/local/bin/jupyter-nbextension
/usr/local/bin/jupyter-nbextensions_configurator
/usr/local/bin/jupyter-notebook
/usr/local/bin/jupyter-qtconsole
/usr/local/bin/jupyter-serverextension
/usr/local/bin/jupyter-troubleshoot
/usr/local/bin/jupyter-trust
/usr/local/lib/python3.4/dist-packages/jupyter-1.0.0.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter.py
/usr/local/lib/python3.4/dist-packages/jupyter_client
/usr/local/lib/python3.4/dist-packages/jupyter_client-4.4.0.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter_console
/usr/local/lib/python3.4/dist-packages/jupyter_console-5.0.0.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter_contrib_core
/usr/local/lib/python3.4/dist-packages/jupyter_contrib_core-0.3.0.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter_core
/usr/local/lib/python3.4/dist-packages/jupyter_core-4.1.1.dist-info
/usr/local/lib/python3.4/dist-packages/jupyter_nbextensions_configurator
/usr/local/lib/python3.4/dist-packages/jupyter_nbextensions_configurator-0.2.2.dist-info

Just to be sure nothing got left behind, update locate's database and run locate jupyter again:

$ sudo updatedb
$ sudo locate jupyter

Once you're sure everything is gone, install with your favourite method (pip/anaconda/...).
In my case, I also had to install notebook, otherwise jupyter would complain that notebook was not a Jupyter command. So:

$ sudo pip3 install jupyter
$ sudo pip3 install notebook

Finally, remove and reinstall nbextensions.

it all boils down to an amazing inability to properly remove jupyter from the system

Thanks @marfcg for that detailed insight! The shell outputs that you get from jupyter contrib nbextensions are outputs of the jupyter contrib command called with no subcommand, from which I infer that it's having trouble locating the subcommand. If you've had problems removing jupyter, then I suspect that maybe an old version of a jupyter cli script was possibly interfering with how subcommands are located. It's possible that this should be filed as an issue with either jupyter/notebook or jupyter/jupyter_core...

Also, from the paths to jupyter binaries, I can see /usr/local/bin/jupyter-contrib, which is provided by the package jupyter_contrib_core at /usr/local/lib/python3.4/dist-packages/jupyter_contrib_core, but I can't see the nbextensions package path, or the binaries it should have provided, which would be /usr/local/bin/jupyter-contrib-nbextension and /usr/local/bin/jupyter-contrib-nbextensions

Was this page helpful?
0 / 5 - 0 ratings