"zsh: bad CPU type in executable" and "mach-o file, but is an incompatible architecture" — what is the Mac actually telling me? Architecture
New Mac, moved my work across, and I now get one of these two errors constantly. Sometimes from a command line tool, sometimes when a Python package imports something.
The second one says have 'x86_64', need 'arm64', which at least sounds like a clue, but I do not know which half of my setup is the wrong one or how it got that way.
What I would like:
- What is the difference between the two errors — are they the same thing?
- How do I find out what architecture something actually is?
- Why did this happen when everything installed without complaining?
@rosetta_reva · 3h ago · 2 replies
Same underlying condition, two different layers noticing it.
"bad CPU type in executable" comes from the system trying to launch a program. You asked to run an Intel binary and there is no translation available for it — usually because Rosetta is not installed.
"mach-o file, but is an incompatible architecture" comes from something trying to load a library into an already-running process. This one cannot be solved by translation at all: a process is either Intel or ARM for its whole life, and you cannot load an Intel library into an ARM process. The error politely names both sides —
have 'x86_64', need 'arm64'means the file on disk is Intel and the process asking for it is ARM.That second one is the one that bites Python users, because a native ARM Python is trying to import a package that shipped an Intel binary. There is no flag that fixes it. The package has to be reinstalled for the right architecture, or the whole environment has to run as Intel.
Reply
Report
@arch_mismatch_ami · 3h ago
"A process is either Intel or ARM for its whole life" is the sentence I needed. I had been looking for a way to translate per-library.
Reply
Report