

You may use a different command instead of python3 to avoid any system discrepancy. Notes: Configuring python3 to use the python installed using the PPA or source will disable the python3 installed using the command sudo apt install python3. We can also switch to other versions by configuring the active command. python3.6, python3.7, etc, you can use the below mentioned commands to activate one installation at a time to use python3 instead of using python3.6 or python3.7 on the command line. If you have installed multiple minor versions of Python i.e. The next section explains the steps to access Python 3.7 from the command line using python3. The above commands will install the most recent version of Python 3.7, but won't enable it to be used using the command python3 from the console as shown above. Also, use altinstall option to avoid overwriting the existing installation. The make command will take some time to build the binaries from the source files. Now compile and build the Python from source and install it using the commands as shown below.
#How to install python 2.7 ubuntu download#
Now download the latest release of Python 3.7 using wget as shown below.Įxtract the tarball after the download completes. Sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev # Uninstall Python 3.7 - Installed using PPA in previous step

#How to install python 2.7 ubuntu code#
In this section, we will install Python 3.7 using the source code without using PPA as shown in the previous step. In this way, we can have multiple versions of Python installed on the same system. It won't override the Python 3.6 installed by us using the command sudo apt install python3 and installs it at a separate location i.e. You can follow the same steps to install Python 3.6 using the same PPA. Now verify the installation using the commands as shown below. The default version of Python 3 remains installed at /usr/lib/python3. The above command will install Python 3.7 at /usr/lib/python3.7. Sudo add-apt-repository ppa:deadsnakes/ppa Sudo apt install software-properties-common In such a case, you may follow the next section to install it from the source code. In several cases, it's not preferred to install Python using PPA. Install Python 3.7 using the commands as shown below. # It will also remove dependent packages including gimp, mysql etc # Uninstall Python - Make sure before going for it If you are not sure, keep the existing version of Python installed on your system since we can install multiple versions of Python on the same system. Make sure before removing existing Python 2.7 and Python 3.6 since several other packages and programs depend on it. Optionally, you may wish to remove Python completely before moving ahead with the next sections using the commands as shown below. You can continue with the next sections to install the most recent version of Python either using the PPA or build from source. We can see that Python 2.7 and Python 3.6 get installed using the Ubuntu repositories which seems outdated as compared to the most recent version of Python i.e. We can install the Python using the package available at the Ubuntu repositories using the commands as shown below. You might also be interested in Python Cheatsheet to learn or brush up the basics of Python. The steps should be the same for other distributions of Linux. It provides the steps for Ubuntu 18.04 LTS. Python 3.7 on the popular Linux distribution Ubuntu. In this tutorial, we will discuss all the steps required to install Python 3 i.e. It soon entered into mainstream programming and majorly popular in data science engineers. Python has emerged as one of the major programming languages used to develop different types of applications including Web Applications, Desktop Applications, Numeric and Scientific Applications, etc.
