Skip to content
Home » Installing Python

Installing Python

Below is a complete, step-by-step, beginner-friendly explanation of Getting and Installing Python, suitable for BCA/MCA, B.Tech, and university exams.


Getting and Installing Python

Python is free, open-source, and available for all major operating systems like Windows, macOS, and Linux. Installing Python ensures you can write, run, and test Python programs on your computer.


1. Downloading Python

To install Python, you need to download the official installer from the Python website.

Official Website

👉 https://www.python.org

Steps:

  1. Open your web browser.
  2. Go to python.org.
  3. Click on the Downloads tab.
  4. The website automatically detects your operating system (Windows, Mac, etc.).
  5. Click the Download Python 3.x.x button (latest stable version).

2. Installing Python on Windows

Step-by-Step Installation:

Step 1: Run Installer

  • Double-click the downloaded file (example: python-3.12.0.exe).

Step 2: IMPORTANT — Check the box

Add Python to PATH
(This makes Python accessible from command prompt.)

Step 3: Choose Installation Type

  • Click Install Now for default installation
    OR
  • Click Customize installation if you want advanced options.

Step 4: Installation Begins

  • Wait for it to complete.

Step 5: Verify Installation

Open Command Prompt and type:

python --version

or

python

If Python is installed correctly, it will display the version.


3. Installing Python on macOS

Steps:

  1. Download the macOS installer (.pkg file) from python.org.
  2. Double-click it.
  3. Follow the on-screen installation wizard.
  4. After installation, open Terminal.
  5. Verify Python using:
python3 --version

Note: macOS uses python3 command instead of python.


4. Installing Python on Linux (Ubuntu/Debian)

Most Linux distributions come with Python preinstalled.

To check version:

python3 --version

To install/update Python manually:

sudo apt update
sudo apt install python3

To install pip (package installer):

sudo apt install python3-pip

5. Installing pip (Python Package Manager)

pip is used to install external Python libraries like pandas, numpy, flask, etc.

To check if pip is installed:

pip --version

If not installed:

python -m ensurepip --default-pip

Or manual installation:

python get-pip.py

6. Installing an IDE or Code Editor

Although Python can be written in any editor, using an IDE makes coding easier.

Popular IDEs for Python:

  • PyCharm (most powerful)
  • VS Code (lightweight, highly recommended)
  • Jupyter Notebook (for data science)
  • IDLE (comes with Python installation)

Installing VS Code:

  1. Go to https://code.visualstudio.com
  2. Download for your OS
  3. Install & add the Python extension from the Extensions tab

7. Running Your First Python Program

Method 1: Using Command Line

Create a file:

hello.py

Add:

print("Hello, Python!")

Run:

python hello.py

Method 2: Using IDLE

  1. Open IDLE (comes with Python).
  2. Type: print("Hello")
  3. Press Enter.

Method 3: Using VS Code

  1. Create a new .py file.
  2. Write your code.
  3. Click Run or press Ctrl+F5.

8. Virtual Environments (Optional but Important)

Virtual environments allow you to create separate spaces for different projects.

Create virtual environment:

python -m venv myenv

Activate:

  • Windows: myenv\Scripts\activate
  • macOS/Linux: source myenv/bin/activate

Deactivate:

deactivate

9. Updating Python

You can always update Python by downloading a newer version from python.org and installing it.
Upgrading will NOT delete your previous programs.


10. Summary

StepDescription
DownloadFrom python.org
InstallRun installer, check “Add to PATH”
VerifyUse python --version
Install pipFor package management
Install IDE(VS Code, PyCharm, IDLE)
Run codeUse terminal, IDLE, or IDE