
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to check version of python modules?
When you install Python, you also get the Python package manager, pip. You can use pip to get the versions of python modules. If you want to list all installed Python modules with their version numbers, use the following command:
$ pip freeze
You will get the output:
asn1crypto==0.22.0 astroid==1.5.2 attrs==16.3.0 Automat==0.5.0 backports.functools-lru-cache==1.3 cffi==1.10.0 ...
To individually find the version number you can grep on this output on *NIX machines. For example:
$ pip freeze | grep PyMySQL PyMySQL==0.7.11
On windows, you can use findstr instead of grep. For example:
PS C:\> pip freeze | findstr PyMySql PyMySQL==0.7.11
If you want to know the version of a module within a Python script, you can use the __version__ attribute of the module to get it. Note that not all modules come with a __version__ attribute. For example,
>>> import pylint >>> pylint.__version__ '1.7.1'
- Related Articles
- How To Check MySQL Version
- How to check the system version of Android?
- How do I check what version of Python is running my script?
- How I can check a Python module version at runtime?
- How to check the OS version in Swift?
- How to use remote python modules?
- How can I check the version of MySQL Server?
- How to deploy python modules on Heroku?
- How to install Python modules in Cygwin?
- How do Python modules work?
- How to install python modules without root access?
- How to use Python modules over Paramiko (SSH)?
- How to check modules, functions, and tables in SAP ERP system.
- How to make unique objects accessible in other modules of Python?
- SQL query to check SAP HANA system version

Advertisements