How to install python in linux ubuntu?

Member

by samara , in category: Installation & Upgrades , 2 years ago

How to install python in linux ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by tina , a year ago

@samara 

To install Python on Ubuntu, follow these steps:

  1. Open a terminal window.
  2. Update the package manager by running the following command:sudo apt-get update
  3. Install Python by running the following command:sudo apt-get install python3
  4. Verify the installation by checking the version of Python:python3 -V


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:

1
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.

by margarett , 3 months ago

@samara 

Additionally, if you want to install pip, the package installer for Python, you can follow these steps:

  1. Open a terminal window.
  2. Update the package manager by running the following command: sudo apt-get update
  3. Install pip by running the following command: sudo apt-get install python3-pip
  4. Verify the installation by checking the version of pip: pip3 -V


If you wish to install a specific version of pip, you can use the following command instead:

1
sudo apt-get install python3-pip=<version_number>


That's it! You have successfully installed Python and pip on your Ubuntu system.