Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross-platform deployment and easy installation [closed]

EDIT

One option I contemplated but don't know enough about is to e.g. for windows write a batch script to:

  • Search for a Python installation, download one and install if not present
  • Then install the bundled package using distutils to also handle dependencies.

It seems like this could be a relatively elegant and simple solution, but I'm not sure how to proceed - any ideas?

Original Question

In brief

What approach would you recommend for the following scenario?

  • Linux development environment for creation of technical applications
  • Deployment now also to be on Windows and Mac
  • Existing code-base in Python
  • wine won't install windows version of Python
  • No windows install CDs available to create virtual windows/mac machines
  • Porting to java incurs large overhead because of existing code-base
  • Clients are not technical users, i.e. providing standard Python packages not sufficient - really requires installable self-contained products

Background

I am writing technical and scientific apps under Linux but will need some of them to be deployable on Windows/MacOs machines too.

In the past I have used Python a lot, but I am finding that for non-technical users who aren't happy installing python packages, creating a simple executable (by using e.g. py2exe) is difficult as I can't get the windows version of Python to install using wine.

While java would seem a good choice, if possible I wanted to avoid having to port my existing code from Python, especially as Python also allows writing portable code.

I realize I'm trying to cover a lot of bases here, so any suggestions regarding the most appropriate solutions (even if not perfect) will be appreciated.

like image 922
jmetz Avatar asked Jan 03 '13 12:01

jmetz


2 Answers

I've got a project that sounds vaguely similar to what you're trying to do and I've seen some of the same problems since I usually develop on Linux and port to Windows. It's a Python + wxPython + NumPy + SciPy + matplotlib + assorted other packages, and what I've found to work best is to use PyInstaller. PyInstaller does an excellent job of handling third party Python packages and creates an EXE pretty painlessly.

I think if you're using py2exe or PyInstaller it more or less has to be done on Windows since IIRC there are a few Windows libs that have to come along for the ride. Maybe you could run a Windows EC2 instance? Depending on how complicated your application is, you might instead be able to make something work with Portable Python or PyPy.

I have tried downloading Python and required packages before for Windows boxes - it worked but it was always a little fragile. If you can find an installer builder that lets you specify dependencies (e.g. Advanced Installer-not free but works well), I'd try that first as it seems to be a little more robust.

like image 133
ChrisC Avatar answered Sep 16 '22 22:09

ChrisC


py2exe works pretty well, I guess you just have to setup a Windows box (or VM) to be able to build packages with it.

like image 40
djc Avatar answered Sep 19 '22 22:09

djc