简体   繁体   中英

Missing numpy lib when trying to install tensorflow

I have numpy install as shown. I'm using the instructions for the M1 chip
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

It was a numpy version issue. I uninstalled everything, then let tensor flow resolve its dependency.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM