各種源修改問題彙總【持續彙總中】

背景

開發過程中,經常遇到軟件源在國外,導致下載很慢的問題,這裏彙總各種國內源以及設置方法

brew源修改

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

參考:https://www.jianshu.com/p/fdf7e316f096

pip源修改

# 騰訊源
pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple

# 清華源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

# 或:
# 阿里源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

# 豆瓣源
pip config set global.index-url http://pypi.douban.com/simple/

下載過程中,如果遇到"--trusted-host"之類的報錯,則只需要在安裝的時候,指定trusted-host即可,如下

pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
 sudo pip3 install -r requirements.txt --trusted-host mirrors.cloud.tencent.com

參考:https://zhuanlan.zhihu.com/p/109939711

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章