Cross-platform deployment and easy installation [closed]
Asked Answered
R

3

5

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.

Rout answered 3/1, 2013 at 12:54 Comment(2)
Beauty is that unix and mac support python out of the box. The only thing you have to make sure is you write your code to be cross platform. So its as simple as dumping the project on their machine and finding python on the path, on windows py2exe or pyinstaller are both good choicesEuphuism
This question should not have been closed. The question regards: 1) Deployment frameworks 2) Development environments, and 3) if there is any prior art regarding the subject.Billye
B
5

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.

Beastly answered 3/1, 2013 at 14:1 Comment(0)
N
2

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

Norven answered 3/1, 2013 at 12:57 Comment(5)
I was worried that that might be the only real solution - guess if no one comes up with any alternatives I'll have to go hunt down windows install media. Thanks!Rout
Any thoughts or ideas regarding my edit about using native scripts to install python and then launch the standard distutils setups?Rout
@mutzmatron My humble impression from writing just a script that sets up a virtualenv for an existing Python installation is that it's nontrivial.Easterner
@delnan - Non-trivial as in just a little involved, but doable (and likely already done by someone) or more like youd-be-silly-to-try-it?Rout
Definitely more involved than just using py2exe or a similar tool. You'd be silly to try it before giving those tools a good shot. You wouldn't be silly to try it if they really don't support your use case well enough (remember, not using windows is not a use case ;-)).Easterner
E
0

I would recommend using py2exe for the windows side, and then BuildApplet for the mac side. This will allow you to make a simple app you double click for your less savvy users.

Efflorescent answered 3/1, 2013 at 12:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.