mac下pip、conda、homebrew修改為清華鏡像源的方法
一、pip 修改為清華鏡像源
① 打開(kāi)終端,輸入 cd ~/.pip/
;如果沒(méi)有 .pip 文件夾,就新建: mkdir .pip
② cd .pip
③ vim pip.conf
④ 粘貼如下內(nèi)容(清華鏡像源),粘貼后,按 ESC 退出編輯模式,按 :wq! 進(jìn)行保存并退出。你可以再打開(kāi)終端依次輸入②和③檢查有沒(méi)有粘貼成功。
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host=pypi.tuna.tsinghua.edu.cn
【備注】 .pip文件路徑為 /Users/你的賬戶(hù)名/ .pip。按shift+command+ .
就能看到這些隱藏文件了,再按一次就能恢復(fù)隱藏。
二、conda 修改為清華鏡像源
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 --set show_channel_urls yes
三、homebrew 修改為清華鏡像源
① 打開(kāi)終端,輸入下面這一行,會(huì)自動(dòng)生成文件名為 brew_install的文件(文件路徑為 /Users/你的賬戶(hù)名/brew_install )
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install
② 右鍵點(diǎn)擊brew_install,打開(kāi)方式選擇 “文本編輯.app”。打開(kāi)后如圖所示,加 # 號(hào)注釋掉原來(lái)的源,再把下面這一行復(fù)制粘貼進(jìn)去即可,保存后關(guān)閉文件。
BREW_REPO = "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git".freeze
③ 終端輸入 /usr/bin/ruby brew_install
耐心等待(也要等很久)
④ 終端輸入下面的內(nèi)容即可完成。(提示:會(huì)自動(dòng)安裝 git 工具,等待即可)
cd "$(brew --repo)" git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git brew update
到此這篇關(guān)于mac下pip、conda、homebrew修改為清華鏡像源的方法的文章就介紹到這了,更多相關(guān)pip、conda、homebrew修改為清華鏡像源內(nèi)容請(qǐng)搜索本站以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持本站!
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。