To install Python on Ubuntu, follow these steps:
This will install the latest version of Python3, which is currently Python 3.10. You can also install a specific version of Python by specifying the version number in the
apt-get command. For example, to install Python 3.8, you would run the following command:
sudo apt-get install python3.8
Note that the
python command may still refer to an older version of Python, such as Python 2. In that case, you can use the
python3 command to run Python 3.
Additionally, if you want to install pip, the package installer for Python, you can follow these steps:
If you wish to install a specific version of pip, you can use the following command instead:
sudo apt-get install python3-pip=<version_number>
That's it! You have successfully installed Python and pip on your Ubuntu system.