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

前端 未结 9 2100
予麋鹿
予麋鹿 2021-01-31 07:46

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

9条回答
  •  别跟我提以往
    2021-01-31 08:00

    Find out which version of Python is installed by issuing the command python --version: $ python --version Python 2.7.10

    If you see something like this, Python 2.7 is your default version. You can also see if you have Python 3 installed:

    $ python3 --version
    Python 3.7.2
    

    If you also want to know the path where it is installed, you can issue the command "which" with python and python3:

    $ which python
    /usr/bin/python
    
    $ which python3
    /usr/local/bin/python3
    

提交回复
热议问题