100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Python

Installing Python and IDE Setup

A practical walkthrough of installing Python 3, verifying the installation, and configuring a code editor or IDE for productive development.

Introduction to PythonBeginner8 min readJul 7, 2026
Analogies

1. Introduction

Before writing any Python program, you need a working Python interpreter installed on your machine and a comfortable environment to write and run code. This lesson covers installing Python 3 on the major operating systems, verifying the installation from the command line, and setting up a popular IDE or code editor (such as VS Code or PyCharm) for a smooth development workflow, including the use of virtual environments to isolate project dependencies.

🏏

Cricket analogy: Just as a player needs the right kit (bat, pads, spikes) fitted and broken in before stepping onto the pitch, a developer needs Python installed and an IDE like VS Code or PyCharm configured, with virtual environments keeping each 'match's' gear separate.

Getting the setup right early avoids common early frustrations like 'python: command not found', mismatched Python versions, or dependency conflicts between unrelated projects.

🏏

Cricket analogy: Just as arriving at the ground without your registered kit gets you turned away, skipping proper Python setup leads to frustrating 'python: command not found' errors and version mismatches before you even start coding.

2. Syntax

text
# Verify Python is installed and check its version (run in a terminal, not a .py file)
python3 --version
# or on some Windows installations:
python --version

# Check that pip (Python's package installer) is available
pip3 --version

# Create an isolated virtual environment for a project
python3 -m venv myproject-env

# Activate it (macOS/Linux)
source myproject-env/bin/activate

# Activate it (Windows PowerShell)
myproject-env\Scripts\Activate.ps1

# Install a package inside the active virtual environment
pip install requests

3. Explanation

On Windows and macOS, the recommended approach is to download the official installer from python.org (or use a package manager like Homebrew on macOS: brew install python). On Linux, Python 3 is usually preinstalled or available via the system package manager (e.g., sudo apt install python3 python3-pip on Debian/Ubuntu). After installation, run python3 --version (or python --version) in a terminal to confirm the interpreter is on the system PATH and reports a Python 3.x version.

🏏

Cricket analogy: Just as different grounds have different pitch-preparation methods - roller for one, covered curator's mix for another - Windows and macOS use the python.org installer or Homebrew, while Linux typically ships Python 3 via apt, and 'python3 --version' confirms the setup like checking the pitch report.

For an editor, VS Code (with the official Python extension) and PyCharm are the two most widely used tools. Both provide syntax highlighting, autocomplete, integrated debugging, and built-in terminal access. A key best practice, regardless of editor choice, is to use a virtual environment (via the built-in venv module) per project — this creates an isolated set of installed packages so that different projects' dependencies don't clash.

🏏

Cricket analogy: Just as a well-equipped nets session offers a bowling machine, video analysis, and a dedicated coach, VS Code and PyCharm offer syntax highlighting, autocomplete, and integrated debugging, while a venv per project keeps each squad's (project's) gear separate.

Common gotcha: On many systems (especially macOS and Linux), the python command may still point to Python 2 or may not exist at all, while python3 reliably points to Python 3. Always verify with python3 --version and prefer python3/pip3 explicitly to avoid accidentally using the wrong interpreter or an unsupported Python 2 environment.

Exam-relevant nuance: pip installs packages into whatever Python environment is currently active. If you forget to activate your virtual environment before running pip install, the package gets installed globally (or into the wrong environment), which is a frequent source of 'ModuleNotFoundError' confusion for beginners.

4. Example

python
# setup_check.py -- a small script to confirm your Python installation is working correctly

import sys
import platform

def check_environment():
    print("Python version:", platform.python_version())
    print("Python executable path:", sys.executable)
    print("Platform:", platform.system())
    major, minor = sys.version_info.major, sys.version_info.minor
    if major < 3:
        print("Warning: You are running Python 2, which is unsupported. Please install Python 3.")
    else:
        print(f"Good to go! Running Python {major}.{minor}")

if __name__ == "__main__":
    check_environment()

5. Output

text
Python version: 3.12.4
Python executable path: /usr/local/bin/python3
Platform: Linux
Good to go! Running Python 3.12

6. Key Takeaways

  • Install Python 3 from python.org, a package manager (Homebrew/apt), or your OS's official channels — never rely on outdated Python 2.
  • Verify installation with python3 --version and confirm pip is available with pip3 --version.
  • On many systems python may not point to Python 3 — prefer the explicit python3/pip3 commands.
  • Use python3 -m venv <name> to create an isolated virtual environment per project, then activate it before installing packages.
  • Popular editors/IDEs for Python include VS Code (with the Python extension) and PyCharm, both offering debugging and autocomplete.
  • Installing packages without an active virtual environment can pollute the global environment and cause dependency conflicts across projects.

Practice what you learned

Was this page helpful?

Topics covered

#Python#PythonProgrammingStudyNotes#Programming#InstallingPythonAndIDESetup#Installing#IDE#Setup#Syntax#StudyNotes#SkillVeris