1.下载安装Anacoda.
资料很多,重要的要根据你的操作系统下载适应版本,一般不会出错。否则,错误太多。
Index of /anaconda/archive/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
本人win7系统下载了。
Anaconda3-2020.02-Windows-x86_64.exe
只要操作系统对应版本没问题,安装不会出错,根据网上的配置,配置相应的path
2.配置Jupyter notebook
生成配置文件 :jupyter notebook --generate-config
主要有两点:修改默认文件夹
用指定浏览器打开软件
import webbrowser
webbrowser.register('chrome', None, webbrowser.GenericBrowser(u'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'))
c.NotebookApp.browser = 'chrome'
3.tensorflow2.0 安装
3.1创建虚拟环境
conda create --name tensorflow python==3.7
python版本要与安装的anaconda安装的相一致,可以查看安装目录
3.2 激活环境
activate tensorflow
3.3 安装相关软件包
conda install numpy matplotlib PIL scikit-learn pandas
或
pip install numpy matplotlib Pillow scikit-learn pandas -i
https://pypi.tuna.tsinghua.edu.cn/simple
3.4 安装 tensorflow
pip install tensorflow==2.0.0 -i
https://pypi.tuna.tsinghua.edu.cn/simple
4.测试安装
输入 python
import tensorflow as tf
5.使用 Anaconda Navigator 打开 jupyter notebook。使用建立的虚拟环境打开
输入程序运行,得到结果 。