尝试安装tensorflow时缺少numpy库

o7jaxewo  于 2022-12-13  发布在  其他
关注(0)|答案(1)|浏览(237)

我有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
ig9co6j1

ig9co6j11#

这是一个 numpy 版本问题。我卸载了所有的东西,然后让tensorflow 解决它的依赖关系。

相关问题