New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when trying to run executable built on M1 (Apple Silicon) #5886
Comments
I have tried both |
I take it you didn't compile the bootloaders? The ones baked into this repository are still boring old |
Since you're on M1, you will need to use |
@bwoodsend, no. I installed this using pip (both the regular release and the dev one). I found this link and I would appreciate some help as to what should be the parameters. |
Okay, I was trying to do this within the files downloaded by pip but there is no |
The following steps should suffice:
Assuming ( |
Thanks @rokm. This works for my test (minimal) script but not for my actual application. It just exits immediately without any error or message. It is a CLI application based on click. I will try to come up with a minimal script and post here (maybe a new issue) but is there something you know that I should do when using click? |
Nothing comes to mind. Does the introductory example from here work for you? |
@rokm, yes, that works. I suppose it has to do with how I have structured the program then. This is the structure.
And this is setuprepo.py (which is my entrypoint. #!/usr/bin/env python3
import sys
from setuprepo import repo
if __name__ == "__main__":
sys.exit(repo.main()) I am building with this command:
I will try variations and see what makes it fail. Please let me know if there is something obvious I am missing and if you prefer me to create another issue. |
My first guess would be that the problem is that both the package and the entry-point script are named |
@rokm, yes, that was the problem! I was so confused. I had stripped down the entrypoint to just a print statement and it still didn't work. I'm curious. Is this a Python thing or something about PyInstaller? After renaming the entrypoint, everything seems to be working but I am testing this further. Thank you for all your help. |
@rokm, one more question here. The binary this produces won't work on macOS on Intel, right? I need to build that binary on that platform. Is this correct? I saw some issues talking about supporting |
See the docs on that topic... |
Speaking of which, I see that it hasn't really rendered properly. |
I suspect this is a side-effect of PyInstalling adding entry pointt's directory to its path; then the entry point script ends up being treated as a stand-alone module and shadows the package (or vice versa). It seems to work normally under python, but that's probably because the interpreter does not care about the entry-point's name (as main module is referred to as
That's right.
It is now possible to attempt to create universal2 binaries as well (by passing Also, as per linked docs, even with
Not strictly. You could probably install x86_64-only homebrew python (not sure how much trickery that involves in brew's case, though) and run it under rosetta on your M1. Then use that to set up a x86_64-only virtual environment, and build x86_64-only version of your application. |
Thanks for all your help here. I have not yet tried the steps to compile an x86 or a universal2 binary (mainly because I have not yet figured out how to do that with homebrew). These notes would help me to do that when I do manage it and get back to my Python module. |
Description of the issue
Context information (for bug reports)
Output of
pyinstaller --version
:4.3
Version of Python: 3.9.5
Platform: macOS
How you installed Python: brew (but pyinstaller is installed within a virtualenv using pipenv)
Did you also try this on another platform? Does it work there?: No, I don't have one at the moment and I am convinced this is a ARM64 issue.
try the latest development version, using the following command:
I get a build error when doing this.
Error when building the minimal program with 5.0.dev0
(https://github.com/pyinstaller/pyinstaller/wiki/If-Things-Go-Wrong) and
Make sure everything is packaged correctly
--noupx
or setupx=False
in your .spec-file--debug
topyi-makespec
orpyinstaller
or useEXE(..., debug=1, ...)
in your .spec file.A minimal example program which shows the error
Stacktrace / full error message
The text was updated successfully, but these errors were encountered: