-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
how to run a Framework build of python (and can that requirement be added to the installation instructions?) #259
Comments
In Anaconda distribution you can use "pythonw" instead. It will use Framework version of python. Like so,
|
Related duplicate issue: #348 @engdan77 have you tried following the OSX instructions in the PyInstaller FAQ for dealing with screen issues? It suggests building with the
|
I tested this and worked for me, even though I have challenges get PyInstaller to use a workable package "windowed" described in #348 ... |
(I now noticed #348 was closed to pasting the answer here instead) Thank you @chriskiehl for such fast feedback, it was indeed a good resource reading "PyInstaller FAQ" that very closely relates to the same symptom that I've been seeing. Even though as I've been generating this "freezed" version by using as below this on a Macbook only while using built-in display it gives this error.
What makes me wonder is that if I follow the exact same steps but instead in a folder create an wx_test.py with the following code
It'll generate a package that you could run either as "dist/wx_test" or "open dist/wx_test.app" and this works without any warnings or issues. While doing the same but instead using widget_demo.py together with this widget_demo.spec (this needed to include e.g. images + languages) it would give this "This program needs access to the screen". Also, obviously there is no issues with neither widget_demo.py (proven when running by "python3 ./widget_demo.py" works perfectly fine), nor PyInstaller since that works perfectly find when packaging wx_test.py. And my understanding was that Gooey uses wx as framework so can't wrap my head around why it would work with this simplified wx_test.py but not widget_demo.py .. But it is correct that while I was also (one of the many approaches) originally used pyenv I learned that you had to install the python-interpreter using this "--include-framework" and also tested anaconda which I also learned that if you wanted to run widget_demo.py you had to to use pythonw instead that I think must have answered @mrosewell issue he had. I am very impressed by the simplicity of Gooey and also that it looks that good so I would be happy to do what I can to help "triage" this. I've spent a couple of days searching internet for others in the same spot which I would not find that unlikely - but the few I've seen are quite old and been using Python2 .. that is why I also now tested the same from another Mac OS 10.13 (High Sierra) using older Python 3.5.4 (installed from Mac binaries from www.python.org) in the hope of that it would make a difference but unfortunately not. Thanks again ... |
has there been any progress in the meantime? Is there a way to use Gooey and PyInstaller on MacOS? How does it work? |
Nothing I've heard or seen 🙄 but I would personally be very happy seeing a "success-story" from someone being able to freeze a MacOS application including Gooey and could perhaps help determine if either I was doing something wrong or something had to be fixed in the source to make this work with PyInstaller (or cx_freeze/py2app) somehow. Or confirm my findings. |
@chriskiehl Is there anyupdate on the issue pointed by @engdan77 |
Awesome @john174586 !! I would have never figured that out :-D I used my previous sample with the difference that I updated the .spec file according to https://chriskiehl.com/article/packaging-gooey-with-pyinstaller to assure languages and images are included and not throwing error because of this. And I ran this "venv/bin/python -m PyInstaller new_test.spec" and within that "dist" folder being created with the binary created I followed your advice creating a "Contents" folder and voila it now starts without any errors. For the future and others perhaps good to either include this piece of advice within the instructions for PyInstaller for MacOS or perhaps we might figure out if there is anything in Gooey that could be changed to make this work without manually adding this folder before running. |
A firm, but not too firm -- quality is what I'm talking about -- handshake offered to anyone who adds their OSX how-to to the wiki. |
Hi all, Somehow, I've managed to get a (A video of the build process here just to show it seems to work https://youtu.be/YxpZQrL8-_g ) This guidance is python3 specific, I should add. In approximately the order I think I hit on things, here goes: Unbuffered outputThis is still an issue, as I've not discovered how to make this work in python3. What I can say, is that the guidance here, about adding these lines, breaks the
I have an SO post open here, looking for an answer to buffered Python3, but so far nothing doing. In the app, literally everything gets dumped to the in-built terminal too, not just the logging I want, so I'm not sure how to separate out these log streams yet either. *.specI think some of the magic comes from having a correct
BuildingThere are a selection of Mac specific things to be done with pyinstaller to get a functioning standalone
Remaining issuesThere are still problems with the logging as I mentioned, which I've not yet been able to resolve. Any help from seasoned Python3 logging users would be appreciated. An Lastly, not an issue per se but creating a singular The comments above about adding a Finally I'll add that I built all of this using
I'll try and update this post with anything else I find out. |
Thanks for sharing @jrjhealey, just as a fyi I was trying to use your .spec file using PyInstaller 3.5, Python 3.6.6 (using venv) on a MacOS 10.14.5 both using the sample Gooey example as a single file and adding it as a package (using main.py etc) like you did with yours. For some reasons I still have the same behaviour as I've seen before that in the dist/ folder I get an xxxx.app (folder-structure) and a xxxx (just a binary file) and the only way I manage to start the application was by creating an empty folder named "Contents" within dist/ and by running the xxxx (this xxxx.app won't open for some reason). When I get a moment I will try your project using "conda" distribution. |
@engdan77 any fixes for this? Same issue here. Thanks! |
Hey @dnides .. the only workable method I found is after you've created a "dist" using PyInstaller you'd need to create an empty folder named "Contents" where you're binary created is found, then it works for me. It does mean though you'd need to do this manually before you distribute this to someone else.. |
Following in the work from @jrjhealey I've managed to create a working app bundle along with the curiosity of his logging problem All I've managed to identify is that this seems to be something PyInstaller is dumping to standard out. as it doesn't actually effect logging level of the loggers i can enumerate at runtime. But I have yet been unable to identify what in PyInstaller or Gooey is responsible for this behavior. |
I have identify the debug information being printed out. It is the verbose output from Python. THe culprit is that we have set the verbose flag in the options passed in the spec options = [('u', None, 'OPTION'), ('v', None, 'OPTION'), ('w', None, 'OPTION')] We are probably better off only setting
Once I did that in my build all the verbose output went away. |
|
I saw the message about needing a Windows framework (which wasn't mentioned in the installation instructions)
figured out that I could do this
Here's what I get when I try to run pythonw on the simple_demo.py in the example files
I guess pythonw isn't the right thing to run a Framework build of python.
Maybe this has something to do with wxPython, but
doesn't work...
What should I be doing to run a Framework build of python?
The text was updated successfully, but these errors were encountered: