Skip to content
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

Frozen platform.machine() returns x86_64 on Apple Silicon M1 macs #5494

Closed
papr opened this issue Jan 21, 2021 · 2 comments · Fixed by #5581
Closed

Frozen platform.machine() returns x86_64 on Apple Silicon M1 macs #5494

papr opened this issue Jan 21, 2021 · 2 comments · Fixed by #5581

Comments

@papr
Copy link

papr commented Jan 21, 2021

Issue: platform.machine() seems to return the result belonging to the machine that froze the program instead of the machine running the program.

This is particular problematic if one needs to run different code based on the runtime architecture.

PyInstaller: 4.2
Python: 3.9.1 (universal2 installer)
Freeze platform: macOS 10.14.6
Runtime platform: macOS 11.1 (M1 chip)

test_platform_machine.py

import platform

print(platform.machine())

Returns the machine type, e.g. 'i386'. An empty string is returned if the value cannot be determined

https://docs.python.org/3/library/platform.html#platform.machine

Expected output: arm64
Actual output: x86_64

I do not know anything about PyInstaller internals but that also might be related to the compatibility mode causing this issue.

Our current workaround is to use os.uname().version instead, which seems to behave correctly.

@rokm
Copy link
Member

rokm commented Jan 21, 2021

The bootloader is currently built only for x86_64.

Can you check if #5315 (comment) helps?

@papr
Copy link
Author

papr commented Jan 21, 2021

This has indeed solved the issue, see #5315 (comment)

@papr papr closed this as completed Jan 21, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants