① 打開(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 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
① 打開(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)文章希望大家以后多多支持腳本之家!
標(biāo)簽:雅安 許昌 西安 辛集 渭南 贛州 濰坊 七臺(tái)河
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《mac下pip、conda、homebrew修改為清華鏡像源的方法》,本文關(guān)鍵詞 mac,下,pip,conda,homebrew,修,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。