Installing Python on Linux

There are many different distributions of Linux available. The instructions to install Python might be different, depending on your specific Linux distribution. In general, you should first check to see if Python is already installed on your system in the Terminal:

$ python --version
$ pip --version

If Python or pip is not installed, or a different version is installed, install them with your Linux distribution's package manager:

  • For Debian derivatives such as Ubuntu, use apt:
$ sudo apt-get install python3 python3-pip
  • For Red Hat derivatives such as Fedora, use yum:
$ sudo yum install python python-pip
  • For SUSE derivatives, use zypper:
$ sudo zypper install python3 python3-pip