Bash Command to Check Python Version

If you want to know which Python version has been installed on your device using the Terminal running the bash shell you can make use of the python or python3 followed by the --version flag.

Example:

$ python3 --version
Python 3.11.4
$ python --version
Python 2.7.1

Note: If Python 2 is not installed on your device, you will get an error.

bash: python: command not found
How to check Python version using bash Command

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!