使用pip 安装tensorflow时,有时候会报如下错误:
No matching distribution found for tensorflow
$ pip install tensorflow --user
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
造成这个的主要原因(不排除其他原因)是pip 使用的版本,位数 和tensorflow发布的不一样(常常有人用32位pip 安装64位tf)。所以安装之前需要检查,不过可以参照下面的方法直接进行指定安装,需要注意的是这里的是mac版本下的安装,安装其他版本需要根据下面语句进行修改
python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
这里提供一个链接,用于查找对应版本(https://www.tensorflow.org/install)