由于一些众所周知的原因,国内使用国外的一些资源比较慢,所以做了一个换源的集合记录下。
PIP
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
临时换源
pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple
永久换源
修改 ~/.pip/pip.conf
(如果没有就创建一个),写入:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
win下面就直接在user目录中创建一个pip目录,如:C:\Users\yourname\pip,新建文件pip.ini,写入:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
收工。
HomeBrew
- 替换brew.git
cd "\$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
- 替换homebrew-core.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
- 替换homebrew-bottles
3.1 bash用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
3.2 zsh用户
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
- 更新
brew update
更加详细的可以看这里