0

With my Mac M1 machine, I wish to use IPython Kernels in coding softwares like VSCode and Spyder, but when importing NumPy from those Kernels, I get the following Error :

Original error was: dlopen(/PATHTOLIBRARY/Python/3.9/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so, 0x0002): tried: '/PATHTOLIBRARY/Python/3.9/lib/python/site-packages/numpy/core/_multiarray_umath.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))

The problem seems to be associated with IPython kernels because when running the respective .py scripts on the terminal, there is no such issue.

I uploaded below a screenshot of the problem: The code (left) works on the terminal (bottom), but not on the interactive window (right).

enter image description here

I have seen quite a few links about this kind of issue (see below), none of which worked for me. In special, I wouldn't like to install conda on my machine.

https://github.com/nteract/hydrogen/issues/2147

https://github.com/quarto-dev/quarto-cli/issues/1133

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

SandPiper
  • 2,816
  • 5
  • 30
  • 52
  • try using anaconda – devin Oct 24 '22 at 16:13
  • I have an m1 mac I remember huge problems especially when I was doing ml algorithms in python anaconda solved most of the issues though – devin Oct 24 '22 at 16:14
  • What version is in your terminal? Do `python3 -V`. Big parts of numpy are written in Fortran, and there's no Fortran compiler for ARM64 yet. – Tim Roberts Oct 24 '22 at 22:26

0 Answers0