Windows安裝Anaconda并且配置國(guó)內(nèi)鏡像的詳細(xì)教程
在學(xué)習(xí)OpenCV或者其他關(guān)于Python技術(shù)的時(shí)候,我們通常需要準(zhǔn)備不同的Python環(huán)境,我選擇了Anaconda作為我的Python環(huán)境管理器。
前言
我們?cè)趯W(xué)習(xí) Python 的時(shí)候需要不同的 Python 版本,關(guān)系到電腦環(huán)境變量配置換來(lái)?yè)Q去很是麻煩,所以這個(gè)時(shí)候我們需要一個(gè)虛擬的 Python 環(huán)境變量,我之前也裝過 virtualenv、virtualenvwrapper、Venv 換來(lái)?yè)Q去麻煩命令一大堆,記不住,最后選擇 Anaconda,用一個(gè)代替全部,只要記住 conda 命令和 pip 命令就好了,不僅省事還方便。conda 命令可以看這個(gè)文章https://ahtelekb.gitee.io/posts/3ca71393/,pip 命令可以看這個(gè)文章https://ahtelekb.gitee.io/posts/41c47cc0/,都是我查閱資料總結(jié)好的,放心食用。
下載 anaconda
anaconda 官網(wǎng)是在國(guó)外,我們?cè)L問的適合會(huì)很卡,下載慢。我提供了一些國(guó)內(nèi)高校鏡像供大家參考。
官網(wǎng)
https://repo.anaconda.com/archive/
https://anaconda.org.cn/
國(guó)內(nèi)鏡像
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 展示(點(diǎn)擊即可下載)
https://mirrors.bfsu.edu.cn/anaconda/archive/Anaconda3-2022.10-Windows-x86_64.exe
安裝 anaconda
無(wú)腦下一步,這兩個(gè)都勾選上

變量環(huán)境
設(shè)置->系統(tǒng)->系統(tǒng)信息->高級(jí)系統(tǒng)設(shè)置->環(huán)境變量->用戶變量->Path下檢查有沒有這五個(gè)變量,沒有就加上

配置國(guó)內(nèi)源
在 Windows 默認(rèn)是沒有.condarc文件的,我們需要 win+r 輸入 cmd 回車,在 cmd 命令行中輸入conda config --set show_channel_urls yes
conda config --set show_channel_urls yes
在C:\Users\你的用戶名目錄下會(huì)生成.condarc文件

將配置文件復(fù)制到復(fù)制到.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
如下圖所示

測(cè)試
# 清除索引緩存 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/
到此這篇關(guān)于Windows安裝Anaconda并且配置國(guó)內(nèi)鏡像教程的文章就介紹到這了,更多相關(guān)Windows安裝Anaconda內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
python爬蟲 2019中國(guó)好聲音評(píng)論爬取過程解析
這篇文章主要介紹了python爬蟲 2019中國(guó)好聲音評(píng)論爬取過程解析,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-08-08
對(duì)Python中數(shù)組的幾種使用方法總結(jié)
今天小編就為大家分享一篇對(duì)Python中數(shù)組的幾種使用方法總結(jié),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來(lái)看看吧2018-06-06
python 去除二維數(shù)組/二維列表中的重復(fù)行方法
今天小編就為大家分享一篇python 去除二維數(shù)組/二維列表中的重復(fù)行方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來(lái)看看吧2019-01-01
python訪問類中docstring注釋的實(shí)現(xiàn)方法
這篇文章主要介紹了python訪問類中docstring注釋的實(shí)現(xiàn)方法,涉及python類注釋的訪問技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-05-05
python面試題之read、readline和readlines的區(qū)別詳解
當(dāng)python進(jìn)行文件的讀取會(huì)遇到三個(gè)不同的函數(shù),它們分別是read(),readline(),和readlines(),下面這篇文章主要給大家介紹了關(guān)于python面試題之read、readline和readlines區(qū)別的相關(guān)資料,需要的朋友可以參考下2022-07-07

