pkg_resources.get_distribution(“ mymodule”)。version在重新加载后未更新

问题描述 投票:0回答:1

我正在使用[检查包是否过期

pkg_resources.get_distribution("mymodule").version

如果版本与最新版本不匹配,我正在运行pip install --upgrade git+...reload('mymodule')可以正确表示所做的更改,但是即使setup.py中的版本被颠簸,上述代码段仍显示先前的版本

我猜该版本仅在每个python会话中更新?还有其他获取实时信息的方法吗?读取最新的dist-info目录是否安全?

我正在使用pkg_resources.get_distribution(“ mymodule”)。version检查软件包是否已过时。如果版本与最新版本不匹配,我正在运行pip install --upgrade git + ....重新加载('...

python pip packaging
1个回答
0
投票

我会尝试reload(pkg_resources)

© www.soinside.com 2019 - 2024. All rights reserved.