pkg_resources.require を使用して、必要なすべてのモジュールが正しいバージョンにインストールされているかどうかを確認したいと思います。すべて正常に動作しますが、pkg_resources で pkg_resource.VersionConflict が発生した場合に情報を出力する方法がわかりません。
インストールされている ccc のバージョンが 1.0.0 であるため、この例では例外が発生します。
dependencies = [
'aaa=0.7.1',
'bbb>=3.6.4',
'ccc>=2.0.0'
]
try:
print(pkg_resources.require(dependencies))
except pkg_resources.VersionConflict:
print ("The following modules caused an error:")
// What do i have to do to print out the currently installed version of ccc and the required version using the returned information from pkg_resourcens//
exit()