How to install python on linux?

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

How to install python on linux?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by kaley , 2 years ago

@caesar_kertzmann 

To install Python on a Linux operating system, you can use the package manager that comes with your distribution.


Here's a general outline of the steps you can follow:

  1. Open a terminal window.
  2. Update the package manager's list of available packages:On Debian, Ubuntu, or another Debian-based distribution:sudo apt-get update On CentOS, Fedora, or another Red Hat-based distribution:sudo yum update
  3. Install Python using the package manager:On Debian, Ubuntu, or another Debian-based distribution:sudo apt-get install python3 On CentOS, Fedora, or another Red Hat-based distribution:sudo yum install python3
  4. Verify that Python has been installed by typing the following command:python3 --version


This should print the version of Python that you have installed.


Note that these instructions are for installing Python 3. If you want to install Python 2, you will need to use a slightly different command. On Debian, Ubuntu, or another Debian-based distribution:

1
sudo apt-get install python


On CentOS, Fedora, or another Red Hat-based distribution:

1
sudo yum install python


I hope this helps! Let me know if you have any questions.