Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to create/distribute a stand alone app based on Jupyter Notebook/JupterLab?

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?

like image 801
Brandon Brown Avatar asked Mar 18 '18 07:03

Brandon Brown


2 Answers

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.

like image 86
Sergio Chumacero Avatar answered Sep 21 '22 13:09

Sergio Chumacero


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.

like image 35
Soren Avatar answered Sep 19 '22 13:09

Soren