Change default Python version from 2.4 to 2.6

前端 未结 6 1998
春和景丽
春和景丽 2020-11-29 23:45

I\'m wanting to use some newer software that requires Python 2.6, and we currently have both 2.4 and 2.6 installed on our dedicated Ce

相关标签:
6条回答
  • 2020-11-30 00:08

    As an alternative, you can also just add an alias for the command "python" in the your bash shell's startup file.

    so open the startup file: emacs ~/.bashrc

    in the editor u append: alias "python" "python2.6"

    and restart the shell.

    0 讨论(0)
  • 2020-11-30 00:08

    Add an alias for the command "python" in the your bash shell's startup file. DON'T change a symbolic link from /usr/bin/python, because changing the default Python (in Ubuntu or Linux Mint for example) may break your system

    P.S.: read other answers

    0 讨论(0)
  • 2020-11-30 00:15

    rm /usr/local/bin/python
    ln -s /usr/local/bin/python2.6 /usr/local/bin/python

    0 讨论(0)
  • 2020-11-30 00:15

    I had similar problem when using meld, I simply renamed the one under local and it worked. Not a good solution I know, but I can always take it back.

    sudo mv /usr/local/bin/python /usr/local/bin/re_python
    
    0 讨论(0)
  • 2020-11-30 00:28

    In CentOS

    ln -sf /usr/local/bin/python2.6 /usr/local/bin/python
    ln -sf /usr/local/bin/python2.6 /usr/bin/python
    

    To check version do:

    python -V
    

    Then to fix yum "No module named yum", you should do:

    vi `which yum`
    

    and modify #!/usr/bin/python to #!/usr/bin/python2.4

    0 讨论(0)
  • 2020-11-30 00:31

    As root:

    ln -sf /usr/bin/python2.6 /usr/local/bin/python
    

    This will make a symbolic link from /usr/local/bin/python --> /usr/bin/python2.6 (replacing the old hardlink).

    0 讨论(0)
提交回复
热议问题