Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check all versions of python installed on osx and centos

I just started setting up a centos server today and noticed that the default version of python on centos is set to 2.6.6. I want to use python 2.7 instead. I googled around and found that 2.6.6 is used by system tools such as YUM so I should not tamper with it. Then I opened up a terminal on my mac and found that I had python 2.6.8 and 2.7.5 and 3.3.3 installed. Sorry for the long story. In short I just want to know how to lookup all the version of python installed on centos so I don't accidentally install it twice.

like image 784
hch Avatar asked May 26 '15 17:05

hch


People also ask

How can I check all the installed Python versions on Linux?

9 Answers. You can use python -V (et al.) to show you the version of Python that the python command resolves to. If that's all you need, you're done. But to see every version of python in your system takes a bit more.


2 Answers

The more easy way its by executing the next command:

ls -ls /usr/bin/python* 

Output look like this:

/usr/bin/python           /usr/bin/python2.7        /usr/bin/pythonw /usr/bin/python-config    /usr/bin/python2.7-config /usr/bin/pythonw2.7 
like image 113
Gabriel Caceres Avatar answered Sep 28 '22 23:09

Gabriel Caceres


we can directly use this to see all the pythons installed both by current user and the root by the following: whereis python

like image 23
Ke Li Avatar answered Sep 29 '22 01:09

Ke Li