python - 如何找到 datetime、math、win32com.client 的版本?
问题描述
我在 Anaconda Prompt 中尝试了以下代码
import <module name>
print(<module name>.__version__)
print(<module name>.version.VERSION)
print(<module name>.version)
但得到AttributeError: 'module' object has no attribute 'version' for each print。
是因为日期时间、数学、win32com.client 是 Python 中的内置库吗?那么如何找到他们的版本呢?
谢谢
解决方案
Python3.x/Lib/__pycache__
您可以在文件夹中找到这些模块的版本 。如文档中所述,版本以这种格式提供module.version.pyc
示例:datetime.cpython-39.pyc表示版本 3.9
其实内置模块的版本和python的版本是一样的。