import tensorflow 出现RuntimeError

import tensorflow

RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb

ImportError: numpy.core.multiarray failed to import

ImportError: numpy.core.umath failed to import

ImportError: numpy.core.umath failed to import

1.错误原因

numpy版本未能达到tensorflow的要求,造成API链接错误

2. 解决方法

升级numpy版本

pip3 install numpy --upgrade