Python Forum

Full Version: packaging a PyQt app for macOS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to package my PyQt based image viewer, shufti, for macOS but I've not had much luck so far. It runs fine from the terminal (if you have Python 3 and PyQt installed already) and  I have already successfully packaged it for Windows using cx_freeze so I was hoping it would be as easy under OSX - nope. I have got a MacPorts version of cx_freeze to spit out a binary but its only a few MB in size when I'd be expecting something closer to 80 MB like the Windows build as it is having to bundle most of python 3, Qt and PyQt. When I run it (from the terminal with open -a) I get a very vague error before being dumped to a (Xcode?) debugger of which I havent got a clue how to use, never having done any OSX dev.

I have found a guide on pythonschool.net (I'm not allowed to post links yet) called 'Distributing your application on OSX' but its quite outdated, following it hasn't worked for me and the author hasn't replied to my email. Nor has the cx_freeze dev, which is a bit concerning but he may just be busy?

My main questions are:

1 - Is cx_freeze the best tool for the job under macOS?

2 - Does cx_freeze work under Sierra?

3 - Do I have to use a specific version of python, PyQt and/or cx_freeze for this to work? Using macports builds of all the python components seems to be the way t go but this requirement is entirely missing from the official cx_freeze docs.

4 - Will the binary work on OSX Intel 10.6+ or will it be Sierra+ only if I build it under Sierra?

Any tips that anyone has on how to bundle and debug pyqt apps for macOS will be greatly appreciated.

Please be aware that shufti is not only my first ever PyQt app, its also the first ever Python app I've written so please go easy on me if you find it on github!

Thanks