开发环境
window10 + python3.5 + anaconda + tensorflow3 + pycharm
安装步骤
- conda添加国内镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
- 添加公司代理
conda config --set proxy_servers.http http://我司账号:我司密码@proxy.huawei.com:8080
conda config --set proxy_servers.https https://我司账号:我司密码@proxy.huawei.com:8080
- 关掉ssl校验
conda config --set ssl_verify false
- 创建并激活TensorFlow虚拟环境
conda create -n tensorflow python=3.5
activate tensorflow
- 安装TensorFlow
conda install -c conda-forge tensorflow
- 检查是否安装成功
>>python
import tensorflow as tf
- 修改pycharm编译器
pycharm-->file-->settings-->project Interpreter-->右边齿轮Add-->conda environment-->existing environment-->添加路径(d:\anaconda3\envs\tensorflow\python.exe)