Anaconda中创建tensorflow环境
需要安装
Anaconda主要是创建新环境和安装tensorflow
方法一
命令行创建环境
win + r输入cmd进入命令行
在命令行中输入
conda create -n tf python=3.7一定要输python的版本号,不然会出错。
如图
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiIwczX0xiRGZkRGZ0Xy9GbvNGL2EzXlpXazxibodlY1p1MMBjVtJWd0ckW65UbM5WOHJWa5kHT20ESjBjUIF2X0hXZ0xCMx81dvRWYoNHLrdEZwZ1Rh5WNXp1bwNjW1ZUba9VZwlHdssmch1mclRXY39CXldWYtlWPzNXZj9mcw1ycz9WL49zZuBnL4gzM4AzNyATM4AjNwAjMwIzLc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
创建完成如图
接下来激活tf环境
输入
activate tf用pip工具安装tensorflow
输入
pip install tensorflow安装完成
方法二
在Anaconda上直接安装
直接点create,选python版本就安装好了
注意事项
用
镜像源下载
先后输入命令
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
和
conda config --set show_channel_urls yes
在C盘 用户名 username有一个.condarc的文件
用记事本打开
修改成成如下
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
-
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
ssl_verify: true
show_channel_urls: true
如图