Python can be installed on different operating systems such as Windows, Linux, and macOS. Follow the steps below to install Python.

1. Download Python

  • Visit the official Python website: python.org
  • Click Downloads.
  • Download the latest stable version for your operating system.

2. Install Python (Windows)

  1. Open the downloaded installer.
  2. Check the box “Add Python to PATH”.
  3. Click Install Now.
  4. Wait for the installation to complete.
  5. Click Close.

3. Verify the Installation

Open Command Prompt and type:

python --version

or

python3 --version

If Python is installed correctly, the version number will be displayed, for example:

Python 3.13.7

Installing an IDE

An IDE (Integrated Development Environment) is software used to write, edit, run, and debug Python programs.

Popular Python IDEs

  1. IDLE (comes with Python)
  2. Visual Studio Code (VS Code)
  3. PyCharm
  4. Jupyter Notebook
  5. Spyder
  6. Thonny

1. IDLE Setup

IDLE is installed automatically with Python.

Steps

  1. Click Start Menu.
  2. Search for IDLE (Python).
  3. Open it.
  4. Click File โ†’ New File.
  5. Write your Python program.
  6. Save the file with the .py extension.
  7. Press F5 or choose Run โ†’ Run Module to execute the program.

Example:

print("Hello, World!")

Output:

Hello, World!

2. Visual Studio Code (VS Code) Setup

Installation Steps

  1. Download and install Visual Studio Code.
  2. Open VS Code.
  3. Install the Python extension from the Extensions marketplace.
  4. Create a new file named hello.py.
  5. Write the Python code.
  6. Click Run or use the integrated terminal.

Example:

print("Welcome to Python")

3. PyCharm Setup

Installation Steps

  1. Download PyCharm Community Edition.
  2. Install and launch PyCharm.
  3. Create a New Project.
  4. Select the installed Python interpreter.
  5. Create a new Python file.
  6. Write the code and click Run.

Writing and Running Your First Program

Create a file named hello.py.

print("Hello, World!")

Save the file and run it.

Output

Hello, World!

Advantages of Using an IDE

  • Syntax highlighting
  • Auto-completion
  • Error detection
  • Debugging tools
  • Code formatting
  • Project management
  • Integrated terminal

Common Installation Problems

ProblemSolution
python command not foundAdd Python to the system PATH or reinstall with Add Python to PATH selected.
IDE cannot find PythonConfigure the correct Python interpreter in the IDE settings.
Program does not runSave the file with a .py extension and ensure there are no syntax errors.