Windows安装Anaconda并且配置国内镜像的详细教程
作者:AhtelekB's?Blog 时间:2023-07-06 13:45:15
在学习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 文件
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
如下图所示
测试
# 清除索引缓存
conda clean -i
conda create -n name
参考资料
https://www.jianshu.com/p/e39cb192bde0
https://mirror.nju.edu.cn/help/anaconda
https://mirrors.pku.edu.cn/Help/Anaconda
https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
https://mirrors.bfsu.edu.cn/help/anaconda/
来源:https://www.cnblogs.com/AhtelekB/p/89ec84c4.html
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python简单连接MongoDB数据库的方法
精妙的SQL和SQL SERVER 与ACCESS、EXCEL的数据导入导出转换
Linux系统中为php添加pcntl扩展
浅谈javascript 迭代方法
MySQL下海量数据的迁移步骤分享
Python 如何反方向迭代一个序列
如何利用python提取字符串中的数字
![](https://img.aspxhome.com/file/2023/7/120647_0s.png)
仅用50行Python代码实现一个简单的代理服务器
设计的技术含量
Python3爬虫学习之MySQL数据库存储爬取的信息详解
![](https://img.aspxhome.com/file/2023/4/79634_0s.png)
详解Python中的正斜杠与反斜杠
SQL语句操作主从关系表
Javascript解决常见浏览器兼容问题的12种方法
![](https://img.aspxhome.com/file/2023/2/136932_0s.jpg)
海量数据库的查询优化及分页算法方案
Python实现的txt文件去重功能示例
深入理解Golang中指针的用途与技巧
![](https://img.aspxhome.com/file/2023/4/123984_0s.png)
学习createTrackbar的使用方法及步骤
![](https://img.aspxhome.com/file/2023/7/121387_0s.jpg)