Skip to content

Latest commit

 

History

History

01_python_fundamentals

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Installing Python: A Comprehensive Guide

This guide provides step-by-step instructions for installing Python on Windows, macOS, and Linux. Follow the steps specific to your operating system to get Python up and running.

Table of Contents

  1. Installing Python on Windows
  2. Installing Python on macOS
  3. Installing Python on Linux
  4. Verifying Your Installation
  5. Troubleshooting

Installing Python on Windows

  1. Download Python: Visit the official Python website and download the latest stable release for Windows.
  2. Run the Installer: Open the downloaded installer. Before clicking "Install Now," ensure you check the box that says "Add Python to PATH." This is crucial for accessing Python from the command line.
  3. Installation Options: You can choose "Install Now" for a quick installation or "Customize Installation" for more control over installation options. If customizing, ensure you select features like "pip" and "IDLE."
  4. Complete Installation: Click "Install Now" or "Install" and wait for the installation to complete. You might need administrative rights to install Python.
  5. Verify Installation: Open a command prompt and type python --version or python3 --version. If you see the Python version, the installation was successful.

Installing Python on macOS

  1. Check macOS Version: Some macOS versions come with a pre-installed Python, but it's often an older version. It's best to install the latest stable release.
  2. Download Python: Visit the official Python website and download the latest stable release for macOS.
  3. Run the Installer: Open the downloaded installer and follow the instructions. The default settings should work for most users.
  4. Complete Installation: After the installation, you might need to restart your terminal or computer for changes to take effect.
  5. Verify Installation: Open Terminal and type python --version or python3 --version. If you see the Python version, the installation was successful.

Installing Python on Linux

  1. Check Existing Python: Most Linux distributions come with Python pre-installed. Open a terminal and type python --version or python3 --version to check.
  2. Install Python (If Needed): If Python is not installed or you want a different version, use the package manager for your distribution:
    • For Ubuntu/Debian: sudo apt update && sudo apt install python3
    • For Fedora/CentOS/RHEL: sudo dnf install python3
    • For Arch Linux: sudo pacman -S python
  3. Verify Installation: After installing, type python --version or python3 --version in the terminal to confirm the installation.

Verifying Your Installation

After installing Python, it's essential to verify that everything is set up correctly:

  1. Command Line Check: Open your command prompt or terminal and type python --version or python3 --version. This should display the installed Python version.
  2. pip Check: Ensure that pip (the Python package installer) is installed by typing pip --version or pip3 --version. If you see a version number, pip is installed correctly.
  3. Running a Script: Create a simple Python script (e.g., hello.py) with the following code:
   print("Welcome to Python Deep Dive!")