Description
Describe the issue:
On my M1 mac, I can build commit d10d17e and import NumPy without issue. With the next commit, 34afbb9, the build seems to be successful, but I get an error when I try to import numpy
at the Python prompt.
I get the full error message below when I use an editible install and try to import NumPy. When I use spin test -v
, the build seems OK, but it fails with the same ImportError
.
In case it matters, I use Miniforge mamba to set up the numpy-dev
environment. This is on a fresh system; I did a factory reset in my attempt to debug this. I've read through https://numpy.org/devdocs/user/troubleshooting-importerror.html as recommended and couldn't find a solution there.
Update: I'm upgrading from Ventura to Sonoma to see if that helps.
Reproduce the code example:
import numpy
Error message:
Traceback (most recent call last):
File "/Users/matthaberland/numpy/numpy/core/__init__.py", line 24, in <module>
from . import multiarray
File "/Users/matthaberland/numpy/numpy/core/multiarray.py", line 10, in <module>
from . import overrides
File "/Users/matthaberland/numpy/numpy/core/overrides.py", line 8, in <module>
from numpy.core._multiarray_umath import (
ImportError: dlopen(/Users/matthaberland/numpy/build/cp39/numpy/core/_multiarray_umath.cpython-39-darwin.so, 0x0002): Symbol not found: _cblas_caxpy$NEWLAPACK
Referenced from: <47F947F4-FE38-32EE-BDCE-DBA4188AAD7D> /Users/matthaberland/numpy/build/cp39/numpy/core/_multiarray_umath.cpython-39-darwin.so
Expected in: <E6C2D470-8878-372D-B9DB-0EDCA1303272> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/matthaberland/numpy/numpy/__init__.py", line 114, in <module>
from numpy.__config__ import show as show_config
File "/Users/matthaberland/numpy/build/cp39/numpy/__config__.py", line 4, in <module>
from numpy.core._multiarray_umath import (
File "/Users/matthaberland/numpy/numpy/core/__init__.py", line 50, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "/Users/matthaberland/miniforge3/envs/numpy-dev/bin/python"
* The NumPy version is: "2.0.0.dev0+git20231007.f204c02"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: dlopen(/Users/matthaberland/numpy/build/cp39/numpy/core/_multiarray_umath.cpython-39-darwin.so, 0x0002): Symbol not found: _cblas_caxpy$NEWLAPACK
Referenced from: <47F947F4-FE38-32EE-BDCE-DBA4188AAD7D> /Users/matthaberland/numpy/build/cp39/numpy/core/_multiarray_umath.cpython-39-darwin.so
Expected in: <E6C2D470-8878-372D-B9DB-0EDCA1303272> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/matthaberland/numpy/numpy/__init__.py", line 119, in <module>
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
Runtime information:
>>> import sys, numpy; print(numpy.__version__); print(sys.version); print(numpy.show_runtime())
2.0.0.dev0+git20231010.d10d17e
3.9.18 | packaged by conda-forge | (main, Aug 30 2023, 03:53:08)
[Clang 15.0.7 ]
WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build information
[{'numpy_version': '2.0.0.dev0+git20231010.d10d17e',
'python': '3.9.18 | packaged by conda-forge | (main, Aug 30 2023, '
'03:53:08) \n'
'[Clang 15.0.7 ]',
'uname': uname_result(system='Darwin', node='Matts-MacBook-Air.local', release='22.1.0', version='Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103', machine='arm64')},
{'simd_extensions': {'baseline': ['NEON', 'NEON_FP16', 'NEON_VFPV4', 'ASIMD'],
'found': ['ASIMDHP'],
'not_found': ['ASIMDFHM']}}]
None