Ali cloud server upgrade python3.6 Ubantu16.04

  1. Download python3.6 from the ppa
    sudo APT-GET install Software-PROPERTIES- Free Real Time the Common 
    # using the "add-apt-repository" script to add ppa current library and automatically import the public
    sudo the Add-APT-Repository ppa: jonathonf / Python - 3.6
    # update the software list sudo APT- GET Update
    # Download python3.6
    sudo APT-GET install python3. 6

     

  2. Change the priority python, because python3 now change the default 3.5 to 3.6
    the sudo Update-Alternatives - the install / usr / bin / to python3 to python3 / usr / bin / to python3. . 5  . 1 
    the sudo Update-Alternatives - the install . / usr / bin / to python3 to python3 / usr / bin / to python3 . 6  2 
    # later figures 2 is the priority or delete the connection will python3 python3.5 directory may be directed python3.6

     

  3. The update pip python
    https://bootstrap.pypa.io/get-pip.py curl | sudo python3.6 

    # version by viewing pip pip -V, here is an update

     #pip position modification

     # 1. Editing bash file

     sudo ./bashrc

     Add the last line

    alias pip3 = '/ usr / local / lib / python3.6 / dist-package / pip' # pip3.6 -V i.e., above the path in view

     Bash # update file

    source ~/.bashrc

     

Guess you like

Origin www.cnblogs.com/emmm/p/12228369.html