How To Check Python Modules Using pip freeze
First step is open Command Line, and then:To list all installed Python modules with their version numbers, use the following command:
- pip freeze
- and then press Enter on the keyboard.
To individually find the version number you can grep on this output on *NIX machines. For example:
- $ pip freeze | grep PyMySQL
- and then press Enter on the keyboard.
- The sample result:
PyMySQL==0.7.11
On windows, you can use findstr instead of grep. For example:
- PS C:\> pip freeze | findstr PyMySql
- and then press Enter on the keyboard.
- The sample result:
PyMySQL==0.7.11
Notes
- pip freeze shows packages that you only installed via pip or pipenv command tool.
- pip freeze excludes package management tools such as pip, wheel, distribute and setuptools, which are not needed for porting environments via requirements.txt, making it ideal for this purpose.
- pip freeze generate output suitable for a requirements file (requirements.txt).
How To Check Python Modules Using pip list
To list all installed Python modules with their version numbers, use the following command:
- open Command Line, and then:
pip list - and then press Enter on the keyboard.
- The sample result:
Package Version
---------------------------------- ----------
PyMySQL 0.7.11
To individually find the version number you can grep on this output on *NIX machines. For example:
- $ pip list | grep PyMySQL
- and then press Enter on the keyboard.
- The sample result:
Package Version
---------------------------------- ----------
PyMySQL 0.7.11
On windows, you can use findstr instead of grep. For example:
- PS C:\> pip list | findstr PyMySql
- and then press Enter on the keyboard.
- The sample result:
Package Version
---------------------------------- ----------
PyMySQL 0.7.11
How To List All Python Modules Index
to list all installed Python modules with python console,
- Open Command Line
- type python command.
and then press Enter on the keyboard. - use the following command:
help("modules")
and then press Enter on the keyboard. - The result will be display all Python modules index that are available after you have installed.
display all Python modules index
Warning:
If you have many installed Python modules, maybe thousands or more, there might be a potential of many spent time to show, so it is not surprising that it might hang your Python interactive console / Python interpreter / Python shell.
< Previous How To Check Your Python Version
Bibliography:
https://docs.python.org/
https://pip.pypa.io/en/stable/
https://www.activestate.com/
https://realpython.com/
https://stackoverflow.com/
https://note.nkmk.me/en/
https://www.tutorialspoint.com/
https://www.digitalocean.com/
Tidak ada komentar:
Posting Komentar