如何找到datetime、math、win32com.client的版本?

2024-05-15 12:52:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我在Anaconda提示符中尝试了以下代码

import <module name>
print(<module name>.__version__)
print(<module name>.version.VERSION)
print(<module name>.version)

但是getAttributeError:“module”对象对于每次打印没有属性“version”

是不是因为datetime、math、win32com.client都在Python的内置库中?那么我如何找到他们的版本呢

多谢各位


Tags: 对象代码nameimportdatetime属性versionmath
1条回答
网友
1楼 · 发布于 2024-05-15 12:52:43

您可以在Python3.x/Lib/__pycache__文件夹中找到这些模块的版本。 如docs中所述,该版本的可用格式为module.version.pyc

示例:datetime.cpython-39.pyc表示版本3.9

事实上,内置模块的版本与python的版本相同

相关问题 更多 >