18

I've built a fairly complex graphical user interface for a data analysis pipeline that a neuroscience lab is using. I built it with Python in a Jupyter Notebook using ipywidgets and various interactive plotting libraries such as bokeh. It's basically just a GUI for an existing Python analysis package, but many researchers don't have any or sufficient programming skills to use it and hence need a GUI.

The problem is that it's a fairly involved setup process. You have to install anaconda, install a bunch of libraries, launch a Jupyter notebook server, etc. This installation process is not feasible for people with minimal tech skills.

How can I package and deliver my Jupyter Notebook app as close to a "download and double-click the installer" type of setup as possible? It needs to be easy for non-tech people. Does the new JupyterLab offer anything here? Could I package it as an Electron app some how?

Brandon Brown
  • 886
  • 1
  • 9
  • 13
  • 1
    nteract (https://nteract.io/) is no-go for those purpose? nteract puts significatnt amount to build integration around jupyter. If you could fit current code / pkg into those distribution, may worth than try to create something from scratch. – OJ Kwon Mar 18 '18 at 23:24
  • One option is to create a tarfile with `conda package` containing your entire environment; this tarfile can then be installed with `conda install --offline `. Note that any locally-compiled libraries (for example, with Cython) will not be relocatable, so this only works if you are using pure python + prepackaged libraries. see [this discussion](https://groups.google.com/a/continuum.io/d/msg/conda/cHBYGHgvMMI/RqHPp-sLEAAJ). – Isaiah Norton Dec 05 '18 at 15:17

2 Answers2

6

Have you tried conda constructor?

  • It creates a double click + follow steps installer, which installs python, conda and specified conda packages.
  • Installing Jupyter this way also creates a start menu entry in windows to start the Jupyter server.
  • It also allows you to specify pre- and post-install batch scripts, that you can use for extra configuration.
  • It can create linux and osx installers as well.

For distribution and updates of apps (.ipynb files), I once used the startup scripts of the Jupyter server to check for newer versions in a github repo and pull the new versions of the files if there were any.

Also, for a friendlier user experience inside Jupyter, check appmode.

David
  • 5,882
  • 3
  • 33
  • 44
  • Would it be possible to add a start menu entry that launches Jupyter into a specific notebook? – Brandon Brown Apr 10 '19 at 17:58
  • 1
    Yes, the tool used by conda to install the start menu item is [menuinst](https://github.com/ContinuumIO/menuinst). It uses a json that specifies the command that runs on click. You can modify this command (and make it open Jupyter on a directory or file) and reinstall the menu item using the python api of menuinst. All this can be done manually or be added to the post-install script of constructor. You can even add your own menu icon. – Sergio Chumacero Apr 10 '19 at 20:08
  • This seems to be the best option at this point. Ideally something like a standalone nteract app on a jupyter notebook would be best, but that doesn't seem to be do-able at this point. – Brandon Brown Apr 10 '19 at 21:03
1

You might be able to use pyinstaller for it. If you can start your program by calling a simple python script.

pip install pyinstaller

pyinstaller --onefile your_script.py

If you execute this in a windows environment a windows exe file is created which contains all the dependencies. I am not sure what happens on a linux system. The exe file may become very large though.

You might run into problems if the script needs any temporary files etc. I am trying to figure that part out myself.

Soerendip
  • 7,684
  • 15
  • 61
  • 128