If you use a Mac or Linux you already have Python installed, Windows doesn’t come with Python installed by default.
But you might have Python 2 and we are going to use Python 3.
Check if you have Python 3 first.
Type the following on a terminal.
python3 -V
Notice the uppercase V
.
If your result is something similar to ‘Python 3.x.y’, for instance, Python 3.8.1
, then you are ready to go.
If not, follow the next instructions according to your Operating System.
Installing Python 3 on Windows
Go to https://www.python.org/downloads/.
Download the latest version.
After the download, double-click the installer.
On the first screen, check the box indicating to "Add Python 3.x to PATH" and then click on "Install Now".
Wait for the installation process to finish until the next screen with the message "Setup was successful".
Click on "Close".
Installing Python 3 on Mac
Install XCode from the App Store.
Install the command line tools by running the following on a terminal.
xcode-select --install
To install Python on a Mac I recommend using Homebrew.
Install Homebrew by running the following on a terminal.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
After that, run the brew
command to install Python 3.
brew install python3
Homebrew already adds Python 3 to the PATH, so you don’t have to do anything.
Installing Python 3 on Linux
To install using apt
, available in Ubuntu and Debian.
sudo apt install python3
To install using yum
, available in RedHat and CentOS.
sudo yum install python3