How to Install Python | Python Tutorial - Learn with VOKS
Back Next

How to Install Python


Python is a popular programming language created by Guido van Rossum and maintained by the Python Software Foundation.

Before writing Python code, you must install it on your computer.

Check If Python Is Already Installed

Before installing, check whether Python is already installed.

Windows / 🍎 macOS / 🐧 Linux

Open:

  • Windows → Command Prompt
  • macOS/Linux → Terminal

Type:

python --version

or:

python3 --version

If installed, you will see something like:

Python 3.12.1

If you see an error like:

python is not recognized

Then you need to install Python.

Downloading Python

Go to the official website:

👉 https://www.python.org

(Managed by the Python Software Foundation)

Click Downloads and choose your operating system.

Installing Python on Windows

Step 1: Download Installer

  • Click Download Python (latest version)

Step 2: Run Installer

IMPORTANT:

Before clicking Install, check:

Add Python to PATH

Then click:

👉 Install Now

Step 3: Verify Installation

Open Command Prompt and type:

python --version

Installing Python on macOS

Step 1: Download

Download from python.org.

Step 2: Open .pkg File

Double-click the downloaded file and follow instructions.

Step 3: Verify

Open Terminal and type:

python3 --version

Installing Python on Linux

Many Linux systems already have Python installed.

Check:

python3 --version

If not installed:

Ubuntu/Debian:

sudo apt update
sudo apt install python3

Fedora:

sudo dnf install python3

Arch:

sudo pacman -S python

Understanding PATH

PATH is a system setting that tells your computer:

"Where is Python located?"

If Python is not added to PATH:

You might see:

python is not recognized as an internal or external command

On Windows:

  • Reinstall Python
  • Make sure ✅ "Add Python to PATH" is checked

Installing pip (Python Package Manager)

pip allows you to install libraries.

Check if pip is installed:

pip --version

or:

pip3 --version

If pip is not installed:

python -m ensurepip --upgrade

Installing an IDE (Code Editor)

You need a program to write Python code.

Popular editors:

| Tool | Type | Beginner Friendly | Notes |
|------|------|------------------|-------|
| IDLE | Built-in | ⭐⭐⭐⭐ | Comes with Python |
| VS Code | Advanced Editor | ⭐⭐⭐⭐⭐ | Most popular |
| PyCharm | Professional IDE | ⭐⭐⭐⭐ | Powerful |
| Notepad | Basic | ⭐ | Not recommended |

Most beginners use:

  • Visual Studio Code
  • PyCharm

Running Your First Python Program

After installing, test it.

Method 1: Interactive Mode

Open terminal:

python

You’ll see:

>>>

Type:

print("Hello, Python!")

To exit:

exit()

Method 2: Running a Python File

Step 1: Create a file:

hello.py

Step 2: Add this code:

print("Hello from file!")

Step 3: Run it:

python hello.py

Python Version Types

There are two main versions:

| Version | Status | Should You Use It? |
|----------|--------|--------------------|
| Python 2 | Deprecated | ❌ No |
| Python 3 | Current | ✅ Yes |

Always install Python 3.

Troubleshooting Common Problems

Problem 1: "python not recognized"

Solution:

  • Reinstall
  • Check "Add to PATH"

Problem 2: Multiple Python Versions

Check:

where python

(macOS/Linux):

which python3


Python
Intorduction Python Syntax Compare to other Programming Languages How to Install Python Print Statement Python Comments Data Structure and Data Type String Operations in Python Simple Input and Output Simple Output Formatting
All Courses
Advance AI Bootstrap C C++ Computer Vision Content Writing CSS Cyber Security Data Analysis Deep Learning Email Marketing Excel Figma HTML Java Script Machine Learning MySQLi Node JS PHP Power Bi Python Python for AI Python for Analysis React React Native SEO SMM SQL