macOS: dlopen: mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')
A library or binary was built for a different CPU architecture than the process loading it.
mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')dlopen mach-o file but is an incompatible architecturemach-o, but wrong architectureincompatible architecture (have 'arm64', need 'x86_64')ImportError: dlopen mach-o file incompatible architecture Meaning
The process is arm64 but the library is x86_64 (or the other way). Reinstall the dependency for arm64 (Homebrew in /opt/homebrew), rebuild native modules (npm rebuild, pip install --force-reinstall), or run the whole stack under Rosetta consistently (arch -x86_64). Mixing Intel and ARM Homebrew prefixes causes this often.
Common causes
- Native module compiled for x86_64 under an arm64 Node/Python
- Libraries from /usr/local (Intel) used by arm64 apps
- Universal binary missing a slice
- Docker platform mismatch
- Old prebuilt wheels
⚡ Quick fix
- Rebuild native modules:
npm rebuild/pip install --no-binary :all: PKG - Reinstall Homebrew packages under /opt/homebrew
- Run everything in Rosetta:
arch -x86_64 zsh
Detailed fix by platform
macOS
lipo -info /path/lib.dylibandfile $(which node)
How to diagnose
- Arch — Process vs library?
- Prefix — /opt/homebrew vs /usr/local?
- Rebuild — Native modules?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- dyld: Library not loaded macOS: dyld[123]: Library not loaded: /usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib — Reason: tried: ... (no such file)
- dyld: Symbol not found macOS: dyld: Symbol not found: _SecTrustCopyCertificateChain — Expected in: /System/Library/Frameworks/Security.framework
- Homebrew Cask: It seems there is already an App at Homebrew: Error: It seems there is already an App at '/Applications/Chrome.app'
Most viewed in macOS
- is damaged and can’t be opened macOS: “App” is damaged and can’t be opened. You should move it to the Trash.
- Operation not permitted (macOS privacy) macOS: Operation not permitted — Terminal/app lacks Full Disk Access (TCC privacy protection)
- zsh: command not found: brew macOS: zsh: command not found: brew (Homebrew not on PATH on Apple Silicon)
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026