我已经安装了如下所示的numpy。我正在使用M1芯片的指令
https://developer.apple.com/metal/tensorflow-plugin/
(base) cody@Codys-MBP ~ % pip install numpy --upgrade --force-reinstall
Defaulting to user installation because normal site-packages is not writeable
Collecting numpy
Using cached numpy-1.23.5-cp39-cp39-macosx_11_0_arm64.whl (13.4 MB)
Installing collected packages: numpy
Attempting uninstall: numpy
Found existing installation: numpy 1.23.5
Uninstalling numpy-1.23.5:
Successfully uninstalled numpy-1.23.5
WARNING: The scripts f2py, f2py3 and f2py3.9 are installed in '/Users/cody/Library/Python/3.9/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.23.5
(base) cody@Codys-MBP ~ % python3 -c "import tensorflow as tf;"
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
这是一个numpy版本问题。我卸载了所有的东西,然后让张量流解决它的依赖。