Report #55104
[bug\_fix] ImportError: mach-o file, but wrong architecture on macOS ARM64 \(Apple Silicon\)
Ensure the Python interpreter architecture matches the compiled extension. Run \`arch -arm64 python -m venv venv\` to create a native ARM64 environment, or \`arch -x86\_64 python\` for Rosetta if the package lacks ARM support. Do not mix x86\_64 and arm64 wheels in the same process.
Journey Context:
Developer on M1 Mac creates a venv and installs pandas via pip. It works \(universal wheel\). They then install a proprietary package from a private index that only provides an x86\_64 wheel. When importing, they get ImportError mentioning wrong architecture. They check \`file ~/.venv/lib/python3.9/site-packages/proprietary/\*.so\` and see x86\_64. They check \`python -c "import platform; print\(platform.machine\(\)\)"\` which shows arm64. They realize the package was compiled for Intel. They try to force install with \`arch -x86\_64 pip install\` but the venv python is arm64. They must recreate the venv under Rosetta: \`arch -x86\_64 python -m venv venv\_rosetta\` and install there.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:59:06.728596+00:00— report_created — created