6
如何以编程方式检查python软件包是否为最新版本?
如何在脚本中以编程方式检查软件包的最新版本,并返回true或false? 我可以使用以下脚本进行检查: package='gekko' import pip if hasattr(pip, 'main'): from pip import main as pipmain else: from pip._internal import main as pipmain pipmain(['search','gekko']) 或使用命令行: (base) C:\User>pip search gekko gekko (0.2.3) - Machine learning and optimization for dynamic systems INSTALLED: 0.2.3 (latest) 但是,如何以编程方式检查并返回true或false?