Hacker News new | past | comments | ask | show | jobs | submit login
Looking at Python for commercial apps but there are problems with packaging
18 points by darreld on Aug 27, 2017 | hide | past | favorite | 9 comments
I'm researching using Python for commercial desktop applications but deployment seems problematic. I'm trying to decide if I'm looking at the wrong technology?

I love the language and I can see how productive I would be in it but I really need to be able to produce clean .exe files to deliver, and I would like for the solution to be cross-platform. I will be using Python 3.6+ and wxpython. cx_Freeze doesn't do single file exe's. Pyinstaller doesn't seem to play well with Python3 (maybe I'm doing it wrong). py2exe doesn't work for me either.

I'm sure there are a lot of very smart people working on this so it must be a hard problem which I would certainly be willing to help with but I'm wondering if I'm picking the wrong technology.

Alternatively I would use JavaFX, which would be fine, just not quite as productive.

Try GUI2Exe, it worked for me pretty well, and as GUI it didn't require to learn all tools command line switches

https://code.google.com/archive/p/gui2exe/ https://launchpad.net/gui2exe

Another great product by Andrea Gavana

Last commit seems to be from 2012 though.

You could take a look at a small project that I did a few years ago to create a portable CPython build for Linux. https://github.com/wavetossed/pybuild The basic idea was to make a CPython binary that did not use any system libraries. Instead, all dynamic linking was to local files within the directory tree of the application. That way you could zip up (or tar up) a directory tree containing this portable Python, its binary libraries and any Python modules/libraries that you needed. The result was a self=contained app that could be copied to any Linux server, unpacked and executed. No prerequisites on the server except a new enough Linux kernel because the Linux ABI changed at some point around 10 years ago or so.

By updating the build script in the Github repo, you could update this to a newer version of Python 3.

To make a Windows binary doing the same thing would require a reasonable amount of knowledge about object files, linking, and Windows DLLs. It might be easier to use the MINGW GCC compiler rather than Microsoft, so consider that possibility. First thing to do is to understand how the CPython binary on Windows works and loads DLLs before actually executing Python code. The key is to intercept this process so that you have total control over all object files and do not rely on anything else being preinstalled on the target system.

I think you named the ones I used a few years ago. cx_freeze and py2exe both had issues. I was using 2.7 at the time, and I managed to get something deployable that didn't require installing system libs, but wasn't a single file either.

Python is my goto language for fast development, but it's always felt a little clunky in windows. You may also need to consider gui issues. we ended up using pyqt, and it didn't quite feel like a windows app either.

You may want to consider, and I hate to say this, javascript for your language. The app we built had pdf libs we needed in python and not in javascript so a browser based solution wasn't available to us at the time. But being able to host the app is generally considered the easiest way to get cross platform these days.

There is also Briefcase, https://pybee.org/project/projects/tools/briefcase/

But last time I looked at it it was very much a work in progress.

Pyinstaller mentions that one of the maintainers does paid support. You mentioned it was commercial software, so perhaps just paying an expert to get things going makes sense.

The outlook is much better in 2017 than it was just a few years ago. Another +1 for PyQt. I wanted a native Mac look and you can get get pretty darn close with Qt. I've also used PyInstaller, which is superbly well documented.

Py2exe with python 2.7 is ised for rcam-pro http://www.vintech.bg

I think you should check Visual Studio with C# and .NET

Thats what I would use (If target machines are windows)

I still havent tried Net core on Unix machines so I cant say much.

If you pack it into exe you lose the cross-platform thing, so you might aswell use any other language.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact