conda配置国内源

简介:Conda 是一个开源的软件包管理系统和环境管理系统,用于安装多个版本的软件包及其依赖关系,并在它们之间轻松切换。Conda 是为 Python 程序创建的,适用于 Linux,OS X 和Windows,也可以打包和分发其他软件。由于某些原因,有时我们需要设置国内源,优化网络配置。

历史攻略:

docker:更换镜像源

miniconda:安装IPython

ubuntu apt 更换阿里云源

miniconda的安装和基本使用

miniconda:安装Jupyter Notebook

centos7.6:安装python、miniconda

pip安装第三方库全攻略:普通安装、安装whl后缀文件、使用国内镜像安装

操作步骤:

# 删除默认的conda镜像源
conda config --remove channels defaults

# 添加国内的镜像源 - 清华镜像源
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/main/

# 验证配置
conda config --show channels

# 清除缓存
conda clean -i

运行参考结果:

(py312) tom@tom:~/tests$ conda config --remove channels defaults
(py312) tom@tom:~/tests$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
(py312) tom@tom:~/tests$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
(py312) tom@tom:~/tests$ conda config --show channels
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
(py312) tom@tom:~/tests$ conda clean -i
Will remove 1 index cache(s).
Proceed ([y]/n)? y

(py312) tom@tom:~/tests$ conda config --show channels
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
(py312) tom@tom:~/tests$
  • 9
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值