一、下載安裝miniconda
miniconde官網(wǎng):Miniconda — Conda documentation
M1最低只能適配到python3.8
打開終端,進(jìn)入安裝包所在文件夾,使用命令進(jìn)行安裝
bash Miniconda3-latest-MacOSX-arm64.sh
一路回車
二、配置環(huán)境
安裝完成后重啟終端,若前面增加(base)則環(huán)境自動(dòng)配置完成,則可以正常使用。
若無,請(qǐng)復(fù)制下面命令并創(chuàng)建文件
vim ~/.zshrc
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/*****/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/*****/miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/*****/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/*****/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
******* 是你的用戶名
重新執(zhí)行剛修改過的環(huán)境
source ~/.zshrc
此時(shí)環(huán)境配置完成, 可以看到已經(jīng)使用conda安裝的python版本了
conda基礎(chǔ)命令
conda/pip 下載第三方包時(shí)默認(rèn)使用國外的源文件,因此在國內(nèi)速度會(huì)比較慢,故通常使用國內(nèi)第
三方鏡像源進(jìn)行下載
查看源
conda config --show channels
添加源
conda config --add channels <parameters>
eg:
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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
# 設(shè)置搜索時(shí)顯示通道地址
conda config --set show_channel_urls yes
刪除源
conda config --remove channels <parameters>
恢復(fù)源(恢復(fù)官方下載地址,清除所有自行添加的第三方源)文章來源:http://www.zghlxwxcb.cn/news/detail-492899.html
conda config --remove-key channels
Conda安裝虛擬環(huán)境相關(guān)命令
文章來源地址http://www.zghlxwxcb.cn/news/detail-492899.html
到了這里,關(guān)于MAC OS(M1)安裝配置miniconda的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!