With PIP, you can list all module versions with the following command:
Check versions of the selected modules
The problem with displaying all these modules occurs when there are dozens or even hundreds of them on the particular machine.
If you know the name of a module to check, you can use additional parameters: findstr for Windows and grep for Linux.
For Windows, this command looks like this and it’s case sensitive.
pip freeze | findstr numpy
In my case, the command will return the following result:
If you want to return multiple results, you can use module names in double-quotes, separated by space.
pip freeze | findstr "numpy Django mysql"
In the case of my system, this command returns versions of three modules:
Django==3.0.3 mysqlclient==1.4.6 numpy==1.16.2
Instead of findstr, Linux uses grep to search for results:
pip freeze | grep boto
This command will display:
If you want to search for multiple modules use the following command:
pip freeze | grep -E "boto|requests|numpy"
This result (on my computer) returns this result:
It didn’t return the numpy version, because there is no numpy module on the machine.