如果我们想知道目前Python中都安装了哪些模块,我们该如何查看呢?#python专栏#

方式一:在python命令中使用命令help('modules')查看

[root@localhost ~]# python

Python 2.7.15 (default, Oct 20 2022, 08:25:27)

[GCC 8.5.0 20210514 (Red Hat 8.5.0-13)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> help('modules')

方式二:使用命令python -m pydoc -p 1234生产网页地址后查看

[root@localhost ~]# python -m pydoc -p 1234

pydoc server ready at http://localhost:1234/

浏览器访问:http://localhost:1234/即可查看。

方式三:使用命令pip list查看,需要提前安装pip模块

[root@localhost ~]# pip -V

pip 20.3.2 from /usr/local/python2.7.15/lib/python2.7/site-packages/pip-20.3.2-py2.7.egg/pip (python 2.7)

[root@localhost ~]# pip list

以上就是Python中已安装模块查看的三种方法了,你学会了吗?

举报/反馈

古今中外畅所欲言

4265获赞 1489粉丝
古往今来,这人世间的事谁能说的清楚
关注
0
0
收藏
分享