Home >Backend Development >Python Tutorial >How Can I List All Locally Installed Python Modules?
Retrieving a List of Locally Installed Python Modules
Obtaining a list of Python modules installed on your computer can be useful for various purposes, such as managing dependencies or verifying module versions. Here's how you can do it:
Solution Using the Python Shell/Prompt
To list installed Python modules, you can use the help('modules') command in a Python shell or prompt. Simply type the following command and press Enter:
help('modules')
This command displays a comprehensive list of all installed modules, organized alphabetically. The output will include both built-in modules that come with the Python interpreter and third-party modules that you have installed.
Note: This solution only lists modules that are currently available in the active interpreter. If you have multiple Python environments or virtual environments installed, you may need to switch to the desired environment to obtain a complete list.
The above is the detailed content of How Can I List All Locally Installed Python Modules?. For more information, please follow other related articles on the PHP Chinese website!