import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)
可以根据自己需要,修改pip命令
另外,注意要在root权限下进行
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)
可以根据自己需要,修改pip命令
另外,注意要在root权限下进行
转载于:https://www.cnblogs.com/liutongqing/p/6841531.html