How to view Python library (linux)

First, use the command line command pydoc
run from the command line to see $ pydoc modules

Second, the use in python interactive interpreter help () to view the
input >>> help ( "modules") to the interactive interpreter, the effect of $ pydoc modules with input from the command line is the same

Third, the interaction is introduced into the python interpreter module sys view
the python sys module also can be used to view information module

SYS Import
sys.modules.keys ()
Fourth, the command line using the pip to see
if you are using a pip as your python package manager, you can run $ pip freeze or $ pip list directly from the command line to view the installation information packet, although other packet manager also has a similar function, while you may be introduced pip python interactive interpreter module to view the package information

import pip
installed_packages = pip.get_installed_distributions()
installed_packages_list = sorted(["%s==%s" % (i.key, i.version)
     for i in installed_packages])
print(installed_packages_list)

Fifth, use the yolk to see the
yolk, then if you have installed can use the yolk command to view packet information, you can use the $ pip install yolk to install it
yolk simple to use, just the command line can operate under

$ yolk -l    #列出所有安装模块
$ yolk -a    #列出激活的模块
$ yolk -n    #列出非激活模块
$ yolk -U [packagename]  # 通过查询pypi来查看(该)模块是否有新版本

Guess you like

Origin www.cnblogs.com/orangestar/p/11626858.html