If you execute again the command: sudo update-alternatives -config python For example we choose the Python3.7 by entering the number 4 You can enter any number and use that Python version. Press to keep the current choice, or type selection number: 4 You should get the following output: 0 /usr/bin/python3.7 4 auto mode Execute the command below: sudo update-alternatives -config python Once, the symlinks are created we can list the installed python versions and switch them easily. Update-alternatives: using /usr/bin/python3.8 to provide /usr/bin/python (python) in auto mode Update-alternatives: using /usr/bin/python3.7 to provide /usr/bin/python (python) in auto sudo update-alternatives -install /usr/bin/python python /usr/bin/python3.8 5 Update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python (python) in auto sudo update-alternatives -install /usr/bin/python python /usr/bin/python3.7 4 Update-alternatives: using /usr/bin/python3.5 to provide /usr/bin/python (python) in auto sudo update-alternatives -install /usr/bin/python python /usr/bin/python3.6 3 Update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto sudo update-alternatives -install /usr/bin/python python /usr/bin/python3.5 2 mo GET YOUR VPS sudo update-alternatives -install /usr/bin/python python /usr/bin/python2.7 1 Sudo update-alternatives -install /usr/bin/python python /usr/bin/python3.8 5Īfter execution, you should receive the following output: Sudo update-alternatives -install /usr/bin/python python /usr/bin/python3.7 4 Sudo update-alternatives -install /usr/bin/python python /usr/bin/python3.6 3 Sudo update-alternatives -install /usr/bin/python python /usr/bin/python3.5 2 We are going to create symlinks for the following Python versions respectively: Python2.7, Python3.5, Python3.6, Python3.7, and Python3.8 Next to the symlink we are going to add the group name python and the option number.Įxecute the following commands one by one: sudo update-alternatives -install /usr/bin/python python /usr/bin/python2.7 1 Once, multiple Python versions are installed, we need to add the symbolic links for every Python version separately. You should receive the following output python3.5 -V P>To check if the Python3.5 is installed successfully, run the following command: python3.5 -V The last Python version that we are going to install is the Python3.5 version: sudo apt install python3.5 -y You should receive the following output python3.6 -V To check if the Python3.6 is installed successfully, run the following command: python3.6 -V Since the repo is already added you need to execute the following command to install Python3.6 sudo apt install python3.6 -y Next version for installing is the Python3.6 version. You should receive the following output python3.7 -V To check if the Python3.7 is installed successfully, run the following command: python3.7 -V Once, the repo is added and the system is updated, execute the command below: sudo apt install python3.7 -y Sudo add-apt-repository ppa:deadsnakes/ppa To install Python3.7, you need to add the repository first: sudo apt install software-properties-common Now we are going to install lower Python3 versions such as Python3.7, Python3.6 and Python3.5 In the previous steps we installed the default Python versions in Ubuntu 20.04, Python3.8, and Python2.7. You should get the following output: python3 -V To check if the Python3 version is installed successfully execute the command below: python3 -V To install the default Python3 version execute the following command: sudo apt install python3 -y You should get the following output: python2 -V To check if the Python2 version is installed successfully execute the command below: python2 -V To install the default Python2 version execute the following command: sudo apt install python2 -y In the first step of this tutorial we are going to install the default Python2 and Python3 versions in Ubuntu 20.04. sudo apt update -y & sudo apt upgrade -y Step 1. User privileges: root or non-root user with sudo privilegesīefore installing anything on your server it is recommended to update the system packages to their latest versions available.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |