原文地址 https://www.bilibili.com/read/cv3568873

虚线内的内容存为 bat 文件双击执行即可更换 pip 源为清华源。

pip 换清华源. bat

@echo off
C:
cd %homedrive%%homepath%
md pip
cd pip
echo [global] > pip.ini
echo timeout = 6000 >> pip.ini
echo index-url = https://mirrors.aliyun.com/pypi/simple/ >> pip.ini
echo trusted-host = pypi.tuna.tsinghua.edu.cn >> pip.ini
pip install --upgrade pip
pause