关于Anaconda及其镜像源的相关问题

1. 创建的虚拟环境中没有bin文件
conda create -n test_env

请在上诉代码后添加对应的python对应版本,即可创建成功

conda create -n test_env python=3.8
2. 关于anaconda中镜像源的相关操作

设置pip的全局索引源为阿里云镜像(注意是全局索引)

pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
pip config set install.trusted-host mirrors.aliyun.com

安装Python包时,会优先从阿里云镜像下载,提高下载速度
在这里插入图片描述
安装Python包时,会优先从阿里云镜像下载,提高下载速度

取消设置的全局镜像源

pip config unset global.index-url

下面是相应的国内的镜像源:

阿里云:
http://mirrors.aliyun.com/pypi/simple/
中国科技大学:
https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣:
http://pypi.douban.com/simple
Python官方:     
https://pypi.python.org/simple/
v2ex:     
http://pypi.v2ex.com/simple/
中国科学院: 
http://pypi.mirrors.opencas.cn/simple/
清华大学:
https://pypi.tuna.tsinghua.edu.cn/simple/

手动添加镜像源,以清华大学的镜像源为例

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

完成上诉操作后:在目录 C:\Users<你的电脑名字> 下就会生成配置文件.condarc,用记事本把这个文件打开,手动删除-defaults,把https换成http:
在这里插入图片描述
再次输入命令:conda config --show channels,就会看到如下的内容

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main

如果要更换下载源,首先要删除之前安装清华源

conda config --remove channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --remove channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --remove channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --remove channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --remove channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2

再次执行:conda config --show channels,就会发现之前的源已经被清楚了

(base) C:\Users\110119>conda config --show channels
channels: []

3.anaconda相关指令

查看虚拟环境

conda env list

删除虚拟环境

conda env remove -n env_name
  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一般的一天

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值