'"incompatible architecture (have 'arm64', need 'x86_64')" error while installing numpy on M1 Mac with pip3 on Python Version 3.10
I was trying to install numpy version 1.22.3 on a M1 Macbook with pip3, and pip3 says the package is present, but when I try to import the module, an error gets thrown at me that saysImporting the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
The full text of the error is:dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-
310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpy
thon-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/_multiarray_umath.cpython-310-da
rwin.so' (no such file)
I followed the link to the troubleshooting documentation provided, and none of the solutions worked.
I've tried reinstalling both pip3 and Python, and that didn't work either.
Any ideas?
Solution 1:[1]
I was able to fix this issue by uninstalling and reinstalling numpy in my virtual environment.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | DharmanBot |