Installation and Setup

Installation and Setup

Installing Python

Windows

1. Download Python from python.org 2. Run the installer 3. Check "Add Python to PATH" 4. Click "Install Now"

macOS

# Using Homebrew
brew install python3

Linux

# Ubuntu/Debian
sudo apt update
sudo apt install python3

Fedora

sudo dnf install python3

Setting Up VS Code

Install VS Code

1. Download from code.visualstudio.com 2. Install the Python extension 3. Select Python interpreter

Create Your First Project

mkdir my-python-projects
cd my-python-projects
code .

Virtual Environments

Why Use Virtual Environments?

Virtual environments keep your project dependencies isolated.

Creating a Virtual Environment

# Create
python -m venv myenv

Activate (Windows)

myenv\Scripts\activate

Activate (Mac/Linux)

source myenv/bin/activate

Package Management

Using pip

# Install a package
pip install requests

List installed packages

pip list

Uninstall

pip uninstall requests

Summary

You now have Python installed and your development environment ready!

Next Lesson

In the next lesson, you'll learn about variables and data types in Python.

Quiz - Quiz - Installation and Setup

1. How do you check Python version in terminal?

2. What is a virtual environment used for?

3. What does pip install do?

Introduction to Python