How to set Python3.5.2 as default Python version on CentOS?

后端 未结 4 1630
北恋
北恋 2020-11-28 07:21

Is there a way to set the Python 3.5.2 as the default Python version on CentOS 7? currently, I have Python 2.7 installed as default and Python 3.5.2 installed separately.

4条回答
  •  遥遥无期
    2020-11-28 08:04

    If this

    sudo ln -fs /usr/bin/python3.5 /usr/bin/python
    

    doesn't work (it should)

    you could just add an alias into your /home/.bashrcwith this command:

    alias python="/usr/bin/python3.5"
    

    and if this does not work either you should just use virtual env. Read this page to get started.

提交回复
热议问题