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

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap