如何检查当前安装的 pdb (Python Debugger) 的版本?

How to check the version of the currnetly installed pdb (Python Debugger)?

查看具体python模块的版本,听说下面是标准的方法之一:

python -c 'import some_module; print (__some_module__.version)'

但是对于python调试器'pdb',上面的思路是行不通的。那我们怎么查看当前安装的pdb的版本呢?

pip freeze 将列出所有当前安装的包

pip freeze | grep pdb

pdb 是一个 Python 标准库。所以你的 Python 的版本就是你的 pdb 的版本(如果我们可以谈论版本的话。你通常会说,pdb in Python X)

阅读:https://docs.python.org/3/library/pdb.html

由于 pdb 在标准库中,它使用 python 版本号,没有自己的版本号。

In general, modules in the standard library SHOULD NOT have version numbers. They implicitly carry the version number of the Python release they are included in.

https://www.python.org/dev/peps/pep-0396/