Bla bla… here’s what you have to do:
- Install nbinteract: pip install nbinteract
(even if you have anaconda installed, use pip)
- Create a git repo for your project – this is important otherwise nbinteract will NOT run
- Make your repo public
- Under settings, enable pages (so that you can host your code on your github.io)
- Clone your repo locally
- Build your beautiful jupyter notebook with Interative widgdets: mynotebook.ipynb
- Open a terminal through jupyter – it is very important that you trigger nbinteract from a Jupyter terminal!
- navigate to the directory of your project
- nbinteract init (it will spit out some messages, and then ask you to create a sample requirements file – accept!)
- Edit your requirements.txt file. Simply list any additional python libs that you are using
- re-run nbinteract init
- commit and push your changes
- nbinteract mynotebook.ipynb will now create a mynotebook.html page!
- commit and push your changes.
This will create a binder image for your repo which will run your python code etc… You can now open the html page locally or put it on your website or open it through you github.io
You may see a temp error (like a module not found). Just be patient for the docker image to load on binder.
Hint of the decade:
To hide code cells from showing up on your website, put #HIDDEN at the top of a cell