(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

Viewed 13110

Followed this guide (Cannot pip install mediapipe on Macos M1) to install Mediapipe on M1 mac, and now I am unable to use pandas or numpy.

ImportError: dlopen(/Users/matthewcuevas/Library/Python/3.8/lib/python/site-packages/pandas/_libs/interval.cpython-38-darwin.so, 0x0002): tried: '/Users/matthewcuevas/Library/Python/3.8/lib/python/site-packages/pandas/_libs/interval.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

3 Answers

This will not be answer to your question/specific situation (most probably), but I got this issue when using python built for pyenv/virtualenv, and rm -rf ~/.pyenv helped me. So, python was reinstalled (properly this time; reinstalled by other scripts in our CI, because I deleted installation), and it's built for x86 and works fine on arm.

I got an error like this too. Solved it after a lot of trial & error.

The Problem: my brew was still running on Rosetta. Fixed that by uninstalling, cleaning and reinstalling. So everything seemed to run fine. Except this problem still kept cropping up

Until I discovered that pip is quite agressive in caching. So it caches the build even if the architecture changed. Solution: pip cache purge. Or remove the whole cache directory which you find with pip cache info

Go to Applications -> Xcode, then right click and select get info. Then enable checbox "Open using Rosetta"enter image description here

Finally close Xcode and open it and try again.

Related