notebook: Lots of problems installing extensions

Apologies for this somewhat long issue. It describes my progress (and ultimate failure) to install jupyter extensions.

I just upgraded from ipython to jupyter and am trying to get my environment working properly. I upgraded using conda (conda install jupyter) and have jupyer 1.0.0 installed.I am trying to get extensions working, following these instructions: https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/Home_Jupyter

First I was stuck on installing extensions: https://github.com/ipython-contrib/IPython-notebook-extensions/wiki/Home_Jupyter#1-installing-an-extension

When I first tried

 jupyter nbextension install usability/codefolding/main --user

I got a long stack trace ending with

IOError: [Errno 2] No such file or directory: u'usability/codefolding/main

It seemed like it was looking for an extension in my local file path, so I surmised I was supposed to clone the IPython-notebook-extensions repo and install the extensions from the base directory.

git clone git@github.com:ipython-contrib/IPython-notebook-extensions.git
cd IPython-notebook-extensions
jupyter nbextension install usability/codefolding/main --user

Still got the IOError. However, examining the repo files, I was able to finally get something to work

jupyter nbextension install usability/codefolding/main.js --user

This command completed without an error, so I assumed it was working. In fact, it put the file main.js into the path /Users/rpa/Library/Jupyter/nbextensions, which I presume is not the desired behavior.

After futher trial and error, I ended up with

$ jupyter nbextension install usability/codefolding --user

which gave me

copying /Users/rpa/RND/open_source/IPython-notebook-extensions/usability/codefolding/codefolding.py -> /Users/rpa/Library/Jupyter/nbextensions/codefolding/codefolding.py
copying /Users/rpa/RND/open_source/IPython-notebook-extensions/usability/codefolding/codefolding.yaml -> /Users/rpa/Library/Jupyter/nbextensions/codefolding/codefolding.yaml
copying /Users/rpa/RND/open_source/IPython-notebook-extensions/usability/codefolding/firstline-fold.js -> /Users/rpa/Library/Jupyter/nbextensions/codefolding/firstline-fold.js
copying /Users/rpa/RND/open_source/IPython-notebook-extensions/usability/codefolding/foldgutter.css -> /Users/rpa/Library/Jupyter/nbextensions/codefolding/foldgutter.css
copying /Users/rpa/RND/open_source/IPython-notebook-extensions/usability/codefolding/icon.png -> /Users/rpa/Library/Jupyter/nbextensions/codefolding/icon.png
copying /Users/rpa/RND/open_source/IPython-notebook-extensions/usability/codefolding/magic-fold.js -> /Users/rpa/Library/Jupyter/nbextensions/codefolding/magic-fold.js
copying /Users/rpa/RND/open_source/IPython-notebook-extensions/usability/codefolding/main.js -> /Users/rpa/Library/Jupyter/nbextensions/codefolding/main.js

Looked good. I now have all the extension files in /Users/rpa/Library/Jupyter/nbextensions/codefolding. So I did

jupyter nbextension enable usability/codefolding/main.js

As far as I can tell, all this does is put the following into /Users/rpa/.jupyter/nbconfig

{
  "load_extensions": {
    "usability/codefolding": true
  }
}

Now I start jupyter in my home directory with jupyter notebook. After creating a new python 2 notebook, I see the followin in the log

[I 12:54:30.137 NotebookApp] Kernel started: 35af37d8-82ec-4899-9b08-633f69adc7e8
[W 12:54:30.185 NotebookApp] 404 GET /nbextensions/usability/codefolding.js?v=20150903125424 (::1) 14.70ms referer=http://localhost:8888/notebooks/Untitled.ipynb?kernel_name=python2

which makes me think that the extension is not being found. Sure enough, the extension doesn’t work. The following cell

import notebook
print(notebook.nbextensions.check_nbextension('usability/codefolding', user=True))
print(notebook.nbextensions.check_nbextension('usability/codefolding/main.js', user=True))

gives me False False.

I am using the most standard platform possible (anaconda on mac) and have tried to follow the instructions carefully, but I really don’t see how to move forward. So there seems to be a bug in either the code or the documentation.

Any advice appreciated.

p.s. The output of my config / path info is

from __future__ import print_function
from jupyter_core.paths import jupyter_config_dir, jupyter_config_path
print(jupyter_config_dir())
print(jupyter_config_path())
/Users/rpa/.jupyter
['/Users/rpa/.jupyter', '/Users/rpa/anaconda/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter']
from __future__ import print_function
from jupyter_core.paths import jupyter_data_dir, jupyter_path
print(jupyter_data_dir())
print(jupyter_path())
/Users/rpa/Library/Jupyter
['/Users/rpa/Library/Jupyter', '/Users/rpa/anaconda/share/jupyter', '/usr/local/share/jupyter', '/usr/share/jupyter']

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 50 (24 by maintainers)

Most upvoted comments

If you are using Jupyter/IPython 4:

  1. Clone the repo
  2. Call python setup.py install
  3. Enjoy 😃