Progress0%

2 of 20 topics completed

Installing Python on Your Computer

In this tutorial, we'll walk through the process of installing Python on your computer. We'll cover installation for Windows, macOS, and Linux operating systems.

Before You Start

Python comes in different versions. We recommend installing Python 3.x (the latest stable version) as it's the current standard and includes all modern features.

Windows

Download the installer from python.org and follow the setup wizard.

macOS

Use Homebrew or download the installer from python.org.

Linux

Most distributions come with Python pre-installed.

Installing Python on Windows

  1. Visit python.org/downloads
  2. Click "Download Python 3.x.x" (latest version)
  3. Run the installer
  4. Important: Check "Add Python to PATH" during installation

After installation, open Command Prompt and verify Python is installed:

Python
1python --version
2# Output: Python 3.x.x

Installing Python on macOS

Method 1: Using Homebrew (Recommended)

Python
1# Install Homebrew first (if not installed)
2/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
3
4# Install Python
5brew install python3

Method 2: Using the Official Installer

  1. Download the macOS installer from python.org
  2. Open the .pkg file and follow the installation wizard
  3. Verify installation in Terminal:
Python
1python3 --version
2# Output: Python 3.x.x

Installing Python on Linux

Most Linux distributions come with Python pre-installed. If you need to install it manually:

Ubuntu/Debian:

Python
1sudo apt update
2sudo apt install python3 python3-pip

Fedora:

Python
1sudo dnf install python3 python3-pip

Setting Up a Code Editor

While you can write Python code in any text editor, we recommend using an Integrated Development Environment (IDE) or code editor for a better coding experience.

Visual Studio Code

Free, lightweight, and powerful. Great for beginners and professionals alike. Download from code.visualstudio.com

PyCharm

Full-featured Python IDE. Available in free (Community) and paid (Professional) editions.

Verifying Your Installation

Let's test your Python installation by running a simple program. Open your terminal or command prompt and type:

Python
1python3
2>>> print("Hello, Python!")
3Hello, Python!
4>>> 2 + 2
54
6>>> exit() # To exit Python interpreter

🎯 Next Steps

Now that you have Python installed, you're ready to write your first program! Continue to the next tutorial where we'll create and run your first Python script.

Related Tutorials

Write your first Python program and understand basic syntax.

Learn more

Learn about different types of data and how to store them in Python.

Learn more

Discover the best tools and IDEs for Python development.

Learn more