anaconda和tensorflow的安装过程记录
首先不要安装python,因为安装anaconda之后会会自带安装python(有版本对应关系)
1.搜索 清华镜像 找到Anaconda3.5.1对应对应版本python是3.6
下载后在win上直接双击运行安装
安装完成之后
通过运行 在命令行conda --version检查版本,证明已安装成功
打开anaconda prompt,输入下面两行命令,更改conda的下载源(清华镜像)提高下载速度
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
然后在命令行输入
pip install tensorflow
完成后输入python
import tensorflow出现错误import error: numpy.core.multiarray failed to import
此时需要卸载numpy: pip uninstall numpy
再次运行:pip install tensorflow
完成后重新import tensorflow
发现没有错误但是出现警告
pip show numpy查看numpy版本
pip install -U numpy==1.13.0更改版本
低版本的numpy(1.13.3)会出现import error: numpy.core.multiarray failed to import
高版本的numpyt(1.16.2)如上出现警告
此时想到安装tensorflow时默认安装了最新版本(1.13.0)
关键的地方!于是想到将tensorflow版本降低
pip install -U tensorflow==1.4.0
pip install -U numpy==1.13.0
输入这两行命令后,再import tensorflow
成功了!!!