In this Python tutorial, you will learn how to install Python 3, verify the installation, run Python from the terminal or Command Prompt, and check whether pip is available for installing Python packages.

Install Python 3 on Windows, macOS, or Linux

Python 3 can be installed in more than one way. On Windows, the easiest method is to use the official installer. On macOS, you can use the official installer or a package manager. On Linux and Unix-like systems, Python may already be installed, and you can either use the system package manager or build Python from source.

This page keeps the original source-build steps and also adds practical checks for modern Python 3 installation, including python --version, python3 --version, and pip verification.

Before Installing Python 3: Choose the Right Method

Use the official Python downloads page when you want the standard installer. Use source build instructions only when you specifically need to compile Python yourself, such as on a Unix-like system or when a required version is not available through your package manager.

  • Windows: download the Python installer and select the option to add Python to PATH during setup.
  • macOS: download the macOS installer or install through a package manager if that is your usual workflow.
  • Linux: first check whether Python 3 is already installed; many distributions include it by default.
  • Source installation: use ./configure, make, and sudo make install when you are compiling Python from source.

Steps to Install Python 3 from the Official Download

Step 1: Download Python 3 from python.org

Download latest Python package available at https://www.python.org/downloads/.

The downloads page shows the latest stable Python 3 release for common platforms. Select the installer or source package that matches your operating system.

Python Download Page - Install Python - Python Environment Setup - www.tutorialkart.com
Python Download Page

Step 2: Read the Python Source Build Instructions

If you downloaded the source package, unzip the downloaded package. Open README.rst file and follow the instructions under “Build Instructions”.

Build Instructions
------------------

On Unix, Linux, BSD, macOS, and Cygwin::

    ./configure
    make
    make test
    sudo make install

This will install Python as python3.

Open the terminal and navigate to the folder.

Python folder - Python Tutorial - www.tutorialkart.com
Python folder

Step 3: Configure the Python 3 Source Build

Run the configure command from inside the extracted Python source directory. This checks your system and prepares the build files.

./configure
Python Installation - Configure Command - Python Tutorial - www.tutorialkart.com
./configure

Step 4: Compile Python 3 Using make

After configuration is complete, run make. This compiles Python from the source code. The command can take some time depending on the system.

make
Python installation - Python Tutorial - www.tutorialkart.com
make

The make test command runs Python’s test suite. It is useful when you want to confirm that the build behaves correctly on your system. For a quick local setup, many users skip this step.

Step 5: Install the Compiled Python 3 Build

Run the install command after compilation is complete. On Unix-like systems, this step may require administrator privileges.

sudo make install
Python Installation - Python Tutorial - www.tutorialkart.com
Install

Step 6: Verify Python 3 Installation in Terminal

Open the terminal and start python with the following command.

python3
Python Installation Verification - Python Tutorial - www.tutorialkart.com
Python Installation Verification

If the Python prompt opens, Python 3 is installed and available from the terminal. To leave the interactive shell, type exit() and press Enter.

Verify Python 3 Version After Installation

Instead of opening the interactive shell every time, you can check the installed Python version directly from the command line.

</>
Copy
python3 --version

On some Windows installations, the command may be python instead of python3.

</>
Copy
python --version

A successful installation prints a Python 3 version number similar to the following.

Python 3.x.x

Run Python 3 on Windows After Installation

On Windows, open Command Prompt or PowerShell and run one of these commands.

</>
Copy
python

If the Python launcher is available, you can also run Python 3 using the py command.

</>
Copy
py

If Windows says that Python is not recognized, Python may not be added to PATH. In that case, run the installer again and choose the PATH option, or repair the installation from the installer.

Check pip After Installing Python 3

pip is the package installer used for installing Python libraries. Many Python installers include pip, but it is still a good idea to verify it after installing Python.

</>
Copy
python3 -m pip --version

On Windows, use this command if python3 is not recognized.

</>
Copy
python -m pip --version

If pip is available, the command prints the pip version and the Python environment path. To install a package, prefer running pip as a Python module.

</>
Copy
python3 -m pip install package-name

Replace package-name with the name of the package you want to install.

Install Python 3 on Linux Using a Package Manager

On Linux, first check whether Python 3 is already installed.

</>
Copy
python3 --version

For Debian or Ubuntu based systems, you can usually install Python 3 and pip with the package manager.

</>
Copy
sudo apt update
sudo apt install python3 python3-pip

For other Linux distributions, use the package manager recommended by that distribution. If you need a version that is not available in your package repository, use the official source package and follow the source build steps shown above.

Common Python 3 Installation Problems and Fixes

ProblemLikely reasonWhat to do
python is not recognized on WindowsPython was not added to PATHRun the installer again and enable the PATH option, or use the Python launcher command py.
python opens Python 2 on an older systemThe system maps python to Python 2Use python3 and python3 -m pip.
pip command is not foundpip is not installed or not on PATHTry python3 -m pip --version or install the pip package for your platform.
sudo make install failsMissing permissions or build dependenciesCheck the error message, install required dependencies, and run the command with proper privileges.

Python 3 Installation FAQ

How do I install Python 3.11 or another specific Python 3 version?

Download the required version from the official Python downloads page if it is available for your operating system. If you need it for a framework such as TensorFlow, first check the framework’s supported Python version range, and then install a compatible Python version.

How do I run Python 3 in Windows?

Open Command Prompt or PowerShell and run python, py, or python --version. If none of these commands work, Python may not be installed correctly or may not be added to PATH.

How do I install pip for Python 3?

First check whether pip is already available using python3 -m pip --version or python -m pip --version. If it is not available, install pip through your operating system package manager or reinstall Python using an installer that includes pip.

Should I use python or python3 command?

Use the command that points to Python 3 on your system. On many Linux and macOS systems, python3 is the safest choice. On Windows, python or py is commonly used.

Do I need to compile Python from source?

Most beginners do not need to compile Python from source. Use the official installer on Windows or macOS, or your Linux package manager. Build from source only when you need a specific version or custom build configuration.

Python 3 Installation QA Checklist

  • Confirm that the Python download link points to the official Python downloads page.
  • Check that Windows instructions mention PATH and the py launcher.
  • Verify that Linux instructions do not overwrite system Python unnecessarily.
  • Test version commands: python3 --version, python --version, and python3 -m pip --version.
  • Keep source-build commands separate from beginner installer instructions.

Summary: Installing Python 3 Correctly

In this Python Tutorial, we downloaded Python 3, reviewed source build steps, installed Python, verified the installation, checked pip, and covered basic fixes for common installation issues. After Python 3 is available from the command line, you can start writing and running Python programs.