pythonlinuxpython-3.xubuntuenvironment-variables

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


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 Python 3.6? All versions are in the /usr/bin/ directory.


Solution

  • do

    rm /usr/bin/python3
    ln -s /usr/bin/python3.6 /usr/bin/python3
    

    much better solution:

    Damn, Python is used throughout much of Ubuntu for system scripts and software, and software relies on having Python (and the commands to start Python) in a certain spot. do back then.

    rm /usr/bin/python3 
    ln -s /usr/bin/python3.5 /usr/bin/python3 
    

    create alias in ~/.bash_aliases

    alias python3='/usr/bin/python3.6' 
    

    Scripts can then start with something like:

    #!/usr/bin/env python3