安装成功:在网速好的情况下 pip install tensorflow==1.2
conda 创建虚拟环境,然后在虚拟环境里面输入下面指令
pip install tensorflow 安装成功但是
python
import tensorflow 报错
因此尝试使用homebrew安装tensorflow
下面的安装我参考了https://blog.csdn.net/sinat_30336721/article/details/82959983
1安装homebrew
https://brew.sh
官网下载
下面是官网上面的下载指令
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2 brew search python3
3 brew install python3
4 export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0rc0-py3-none-any.whl
5 sudo pip3 install --upgrade $TF_BINARY_URL
成功安装
但是imprort tensorflow的时候会有很多警告
>>> import tensorflow
/Users/zjc/zjc_work/anaconda3/envs/tf-cpu/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:421:FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.