升级的时候注意权限

import pip
from subprocess import call

for dist in pip.get_installed_distributions():
    call("pip install --upgrade -i https://pypi.douban.com/simple/ " + dist.project_name, shell=True)