Home > Enterprise >  Complete list of packages in python 3.x
Complete list of packages in python 3.x

Time:07-20

Where can I find the full list of packages in python 3.x.

I have been searching on google - couple of web-site, but neither lists the full list.

Please help.

Thanks,

CodePudding user response:

While there will never be a list of every single library ever made for Python due to there being no single centralized distributing system, there's a couple of places you can always check:

Python standard library for the packages included with a Python install: https://docs.python.org/3/library/

Python package index for at least most of the commonly used libraries: https://pypi.org/

CodePudding user response:

  1. You can use sys.module to view already imported modules. See the doc.

  2. If you want to see all available modules, not just the already imported ones, there is no such mechanism. But you could search for relevant folders and directories in the paths python will search to import modules, and guess which files/directories actually represent a python module (e.g. which files ends with .py, which dirs have a __init__.py… The list of search paths is in sys.path. So you could do

    import sys, os for python_search_path in sys.path: for item in os.listdir(python_search_path): module_file_candidate = os.path.join(python_search_path, item) # Test if module_file_candidate is a path to a module file/directory

    To do the check, you could use the help of the import module, importlib, and function like importlib.util.find_spec, importlib.machinery.SourceFileLoader.is_package() or importlib.machinery.all_suffixes()

  3. If you install all you extraneous packages with pip, you can get them also with pip list in a shell or by using subprocess.check_output(["python", "-m", "pip", "list"])

Package            Version
------------------ ---------
algdeps            4.3.0
backoff            1.11.1
certifi            2021.10.8
charset-normalizer 2.0.9
docopt             0.6.2
idna               3.3
importlib-metadata 4.8.2
keyring            23.4.0
pip                22.0.4
pyparsing          3.0.6
pywin32-ctypes     0.2.0
requests           2.26.0
setuptools         58.1.0
urllib3            1.26.7
zipp               3.6.0
  • Related