Skip to content

Instantly share code, notes, and snippets.

@rossant
Last active March 26, 2016 18:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rossant/15698fdedea2ea53fe8f to your computer and use it in GitHub Desktop.
Save rossant/15698fdedea2ea53fe8f to your computer and use it in GitHub Desktop.
Build cross-plaform graphical installers for Python software

Distributing Python software to non-technical users is too hard. We need to make it simpler.

I'm imagining a tool based on conda.

Ideally I'd like to have something like this:

  • I write an environment.yml file with the conda/pip dependencies for my software
  • I write an installer.yml file that describes my installer: package name, paths to logo/images, icon shortcuts for binaries, etc.
  • I type build-installer and a few files are created:
    • mypackage.sh: for Unix systems
    • mypackage.dmg: for OS X
    • mypackage.exe: for Windows
    • mypackage.deb: for Debian

When executed by the clients, these installers all do the same thing under the hood:

  • download the latest miniconda and install it in the install directory chosen by the user
  • create an env using environment.yml
  • put both miniconda/bin and miniconda/envs/myenv/bin in the system path (if the user has checked that box during the installation process)
  • create the shortcuts

There could also be an Update shortcut that does conda update ... where the list of packages to update is specified in install.yml

constructor does something like this. However, it prebuilds the environment, whereas I'd prefer to have it built when the user installs the software (which requires a live Internet connection).

@mlgill
Copy link

mlgill commented Mar 23, 2016

Your thinking is more sophisticated than mine, but I've been hacking around on a shell script to do something similar here. Happy to help if you decide to work on this.

@rossant
Copy link
Author

rossant commented Mar 23, 2016

@mlgill thanks, that looks interesting! @nippoo also had started something like this for one of our projects: https://github.com/kwikteam/phy-install
I think these solutions would be good starting points. Now, need to check how to bundle these scripts into nice graphical installers...

@jwnelson
Copy link

I've been working on this problem with distributing internal company python tools. Biggest issue has consistently been getting all the dependencies in order when installing on a new machine. My solution so far has been to build a dedicated conda environment with all necessary dependencies for an application and export it as a yml that gets version controlled in that project's/application's git repo. Then to install on a new machine, you just install conda and git, clone the repo, and create the environment from the yml.

Next step is to handle all the conda CLI stuff for the user (preferably with a gui) and make it cross platform (easier said than done), but using conda to keep track of dependencies for an application like this definitely simplifies a lot of the install process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment