Windows安装Anaconda并且配置国内镜像教程

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
在学习OpenCV或者其他关于Python技术的时候,我们通常需要准备不同的Python环境,我选择了Anaconda作为我的Python环境管理器。

前言

我们在学习 Python 的时候需要不同的 Python 版本,关系到电脑环境变量配置换来换去很是麻烦,所以这个时候我们需要一个虚拟的 Python 环境变量,我之前也装过 virtualenv、virtualenvwrapper、Venv 换来换去麻烦命令一大堆,记不住,最后选择 Anaconda,用一个代替全部,只要记住 conda 命令和 pip 命令就好了,不仅省事还方便。conda 命令可以看这个文章https://ahtelekb.gitee.io/posts/3ca71393/,pip 命令可以看这个文章https://ahtelekb.gitee.io/posts/41c47cc0/,都是我查阅资料总结好的,放心食用。

视频教程

下载 anaconda

anaconda 官网是在国外,我们访问的适合会很卡,下载慢。我提供了一些国内高校镜像供大家参考。

官网

https://repo.anaconda.com/archive/

https://anaconda.org.cn/

国内镜像

https://mirrors.bfsu.edu.cn/anaconda/archive/

https://mirrors.xjtu.edu.cn/anaconda/archive/

https://mirror.bjtu.edu.cn/anaconda/archive/

https://mirrors.hit.edu.cn/anaconda/archive/

https://mirrors.aliyun.com/anaconda/archive/?spm=a2c6h.25603864.0.0.2da34eb925S2Ym

以清华源的 Anaconda3-2022.10-Windows-x86_64 展示(点击即可下载)
https://mirrors.bfsu.edu.cn/anaconda/archive/Anaconda3-2022.10-Windows-x86_64.exe

安装 anaconda

无脑下一步,这两个都勾选上
无脑下一步,这两个都勾选上

变量环境

设置->系统->系统信息->高级系统设置->环境变量->用户变量->Path下检查有没有这五个变量,没有就加上
变量环境

配置国内源

在 Windows 默认是没有.condarc文件的,我们需要 win+r 输入 cmd 回车,在 cmd 命令行中输入conda config --set show_channel_urls yes

conda config --set show_channel_urls yes

C:\Users\你的用户名目录下会生成.condarc文件
生成.condarc文件

将配置文件复制到复制到.condarc 文件

channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

如下图所示
复制到.condarc 文件

测试

# 清除索引缓存
conda clean -i

conda create -n name

参考资料

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: windows