Answers
jm13fire 2015-05-26T18:15:53
As someone mentioned in a comment, you can use which python if it is supported by CentOS. Another command that could work is whereis python. In the event neither of these work, you can start the Python interpreter, and it will show you the version, or you could look in /usr/bin for the Python files (python, python3 etc). ",
nurealam siddiq 2019-09-09T03:39:32
It depends on your default version of python setup. You can query by Python Version:\n\npython3 --version //to check which version of python3 is installed on your computer\npython2 --version // to check which version of python2 is installed on your computer\npython --version // it shows your default Python installed version.\n",
Appaji Chintimi 2020-12-13T13:16:35
compgen -c python | grep -P '^python\\d'\n\nThis lists some other python things too, But hey, You can identify all python versions among them.",
tsm 2021-08-19T09:34:38
Sift through the output of this script.\nsudo find / -name 'python*' -type f -exec du -h {} + | sort -r -h ~/Documents/python_locations.txt\n",
Gabriel Caceres 2016-08-23T12:34:59
The more easy way its by executing the next command:\n\nls -ls /usr/bin/python*\n\n\nOutput look like this:\n\n/usr/bin/python /usr/bin/python2.7 /usr/bin/pythonw\n/usr/bin/python-config /usr/bin/python2.7-config /usr/bin/pythonw2.7\n",
george mano 2021-10-11T22:34:41
ls -l /usr/bin/python* & ls -l /usr/local/bin/python*\n",
Ke Li 2019-06-15T00:51:13
we can directly use this to see all the pythons installed both by current user and the root by the following: \n whereis python",
Singh 2021-11-28T13:55:42
I would add to @nurealam siddiq answer,\npython --version // it shows your default Python installed version.\n\npython2 --version // to check which version of python2 is installed \n\npython3 --version //to check which version of python3 is installed \n\npython3.X --version // to further check which python3.X is installed\n\n",
KPandian 2019-03-13T15:35:31
Find out which version of Python is installed by issuing the command \npython --version:\n $ python --version\n Python 2.7.10\n\nIf you see something like this, Python 2.7 is your default version. You can also see if you have Python 3 installed:\n\n$ python3 --version\nPython 3.7.2\n\n\nIf you also want to know the path where it is installed, you can issue the command \"which\" with python and python3:\n\n$ which python\n/usr/bin/python\n\n$ which python3\n/usr/local/bin/python3\n",
Jatin 2023-02-11T14:58:11
To check python versions installed in your OS you can run the below commands:-\npython2 -version\npython3 -version\n",
danbros 2019-08-13T21:04:11
Here is a cleaner way to show them (technically without symbolic links). This includes python2 and python3 installs:\nls -1 /usr/bin/python* | grep '.*[2-3]\\(.[0-9]\\+\\)\\?$'\n\nWhere grep filters the output of ls that that has that numeric pattern at the end ($).\nOr using find:\nfind /usr/bin/python* ! -type l\n\nWhich shows all the different (!) of symbolic link type (-type l).",
lpsandaruwan 2015-05-26T18:31:41
Use, yum list installed command to find the packages you installed.",
Alan O'Meara 2019-09-30T17:19:14
COMMAND: python --version && python3 --version\n\nOUTPUT:\n\n\n Python 2.7.10 \n Python 3.7.1\n\n\nALIAS COMMAND: pyver\n\nOUTPUT:\n\n\n Python 2.7.10 \n Python 3.7.1\n\n\nYou can make an alias like \"pyver\" in your .bashrc file or else using a text accelerator like AText maybe.",