Anaconda 添加清华镜像源

在安装tensorflow时,不知道怎么了,一直安装不上去,所以重新配置了下镜像
安装环境:win10+anaconda3.5

  1. 删除之前的镜像源,恢复默认状态
conda config --remove-key channels
  1. 添加清华镜像源 清华大学开源软件镜像站
#添加镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

#显示检索路径
conda config --set show_channel_urls yes

#显示镜像通道
conda config --show channels
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

在这里插入图片描述

  1. 安装conda install tensorflow时仍然报错,解决方案如下:
  • 打开.condarc文件,win10是在C:\Users\用户名文件夹中,用记事本打开即可,删除 -defaults,好像还是不行
  • 接下来,将https全部改为http,经测试可以成功安装tensorflow

conda config --remove channels defaults
在这里插入图片描述
查看是否安装了gpu版本
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

  1. 国内常见的镜像源
pip install numpy -i https://mirrors.aliyun.com/pypi/simple/

国内常用源镜像地址:
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:https://mirrors.aliyun.com/pypi/simple/
中国科技大学: https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:https://pypi.hustunique.com/
山东理工大学:https://pypi.sdutlinux.org/ 
豆瓣:https://pypi.douban.com/simple/
  1. 补充:conda的常用命令
  • 查看所有虚拟环境 conda info --env 在显示的环境中,有*的表示当前所在的环境
  • 创建环境 conda create -n envname python=3.6(指定python版本为3.6)
  • 启动环境 conda activate envnane
  • 关闭环境 conda deactivate envname
  • 删除环境 conda remove -n envname --all
  • 克隆环境 本地已有一个环境AAA,若需要创建一个同样的BBB conda create -n BBB --clone AAA
  1. linux安装tensorflow
  • anaconda search -t conda tensorflow 查看tensorflow版本,根据自己的系统环境,选择指定的版本
  • anaconda show <NAME/PACKAGE>显示版本的详细信息,并根据最后一句话进行安装

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 94
    点赞
  • 518
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值