运行以下代码块就可以用清华源升级所有的包
import pkg_resources
from subprocess import call
packages = [dist.project_name for dist in pkg_resources.working_set]
call("pip3 install " + "-i https://pypi.tuna.tsinghua.edu.cn/simple" + " --upgrade " + ' '.join(packages), shell=True)