Python2和3切换默认

作者: Shalom小白 | 来源:发表于2017-02-23 14:57 被阅读48次

    ➜ ~ which python
    /usr/local/bin/python
    ➜ ~ python -V
    Python 3.5.0
    ➜ ~ python2 -V
    Python 2.7.6
    ➜ ~ python3 -V
    zsh: command not found: python3
    ➜ ~ which python
    /usr/local/bin/python
    ➜ ~ l /usr/local/bin/python
    lrwxrwxrwx. 1 root root 35 Nov 4 2015 /usr/local/bin/python -> /usr/local/Python-3.5.0/bin/python3
    ➜ ~ cd /usr/local/bin/
    ➜ which python2
    /usr/bin/python2
    ➜ ls -alch py*
    lrwxrwxrwx. 1 root root 35 Nov 4 2015 python -> /usr/local/Python-3.5.0/bin/python3
    ➜ ln -s /usr/bin/python2 python
    ln: creating symbolic link `python': File exists
    ➜ rm -rf python
    ➜ ln -s /usr/bin/python2 python
    ➜ cd
    ➜ ~ python

    相关文章

      网友评论

        本文标题:Python2和3切换默认

        本文链接:https://www.haomeiwen.com/subject/ailbwttx.html