How can I use jupyter notebook with binder and appmode?

142 Views Asked by At

I want to create demo app by jupyter notebook and appmode and then would like to push to binder. However, after pushing to binder, we can't use appmode in that notebook. Should I do anything special for that?

I tried to add 'environment.yml'

channels:
  - conda-forge
dependencies:
  - appmode

and 'postBuild'


#!/bin/bash

# Appmode Jupyter拡張機能のインストール
jupyter nbextension install --py --symlink --sys-prefix appmode
jupyter nbextension enable --py --sys-prefix appmode

# Appmodeの有効化
jupyter serverextension enable --py --sys-prefix appmode

and 'requirements.txt'

appmode
1

There are 1 best solutions below

2
Wayne On

I'm going to guess you ran into this issue. A workaround to allow the appmode to work again at present without a '400: Bad Request' page is there. I've tested it in sessions launched via MyBinder and it presently enables appmode to work again.

You need to add a file named jupyter_notebook_config.py in the root of your repo. The contents of that file should be:

c.ContentsManager.allow_hidden = True

I tested it already in conjunction with using a binder directory for the my binder configuration files. The jupyter_notebook_config.py stays in the root of the repo and does NOT belong inside the binder directory. (This is demonstrated by this launch, which corresponds to this particular commit of that repo with jupyter_notebook_config.py in root, in combination with a binder directory.)

Another test with jupyter_notebook_config.py in root and a binder directory is here. (Oddly, adding vpython as a pip installation breaks the fix; I don't understand this incompatibility, but I'm certain after quite a bit of testing it is an issue.)


I've implemented the same fix at these two, that don't involve a binder directory and I'm leaving them here as other examples of the fix: