How to make python3 command run Python 3.6 instead of 3.5?

前端 未结 4 452
南笙
南笙 2021-01-30 17:19

I just downloaded Python 3.6.1, but when I type python3 -V in the terminal it\'s still Python 3.5.3. How can I make python3 point to

4条回答
  •  耶瑟儿~
    2021-01-30 17:49

    If you are looking for other than the accepted answer. Here is the solution that saved my life. This is to replace it with new version.

    
    $ python3 --version
      Python 3.5.2
    
    $ ls -lh /usr/bin/python3
      lrwxrwxrwx 1 root root 9 Mar 23  2016 /usr/bin/python3 -> python3.5
    
    $ sudo mv /usr/bin/python3 /usr/bin/_python3
    $ sudo cp /usr/bin/python3.6 /usr/bin/python3
    
    $ python3 --version
      Python 3.6.11
    
    

提交回复
热议问题