Skip to content

Python Development Setup Guide for macOS ​

Welcome to your Python development journey! Follow this guide to set up your macOS environment with the necessary tools and configurations. Let’s get started!

1. Software Requirements for Python Setup on macOS ​

πŸ–₯️ Visual Studio Code ​

Purpose: The main Integrated Development Environment (IDE) for Python coding.

Steps

Download and Install Visual Studio Code:

  1. πŸ“₯ Visit the Visual Studio Code website.
  2. πŸ–±οΈ Download the macOS installer (.zip file).
  3. πŸ”„ Extract the downloaded .zip file.
  4. βž• Important: Move the Visual Studio Code.app to the Applications folder for easy access.
  5. πŸ› οΈ (Optional): Install the code command in PATH by opening VS Code, pressing Cmd+Shift+P, typing shell command, and selecting Shell Command: Install 'code' command in PATH.

πŸ› οΈ GIT ​

Purpose: Version control system to track code changes.

Steps

Download and Install GIT:

  1. 🌐 Open your terminal.
  2. πŸ“₯ Install GIT using Homebrew:
    bash
    brew install git
    (If Homebrew is not installed, install it by following the instructions at Homebrew's official website.)
  3. βœ… Verify the installation:
    bash
    git --version

Verification:

bash
git --version

πŸ“Š This command should display the installed Git version.

🐍 Python 3.13 ​

Purpose: The main language runtime.

Steps

Download and Install Python 3.13:

  1. 🌐 Open your terminal.
  2. πŸ“₯ Install Python 3.13 using Homebrew:
    bash
    brew install python@3.13
  3. βž• Important: Ensure Python 3.13 is linked correctly:
    bash
    brew link --force python@3.13
  4. πŸ”„ (Optional): Verify the installation path and add it to your shell profile if necessary.

Verification:

bash
python3 --version

🐍 This should output Python 3.13.x, confirming the installation.

2. Minimum Laptop Requirements ​

To ensure a smooth development experience, your laptop should meet the following specifications:

  • Operating System: macOS Catalina (10.15) or later.
  • Processor: Intel i5 (8th Gen or newer) or Apple M1/M2 chip.
  • RAM: Minimum of 16 GB.
  • Storage: SSD with at least 256 GB for faster file access and better overall performance.
  • Additional: At least one USB-C/Thunderbolt port and stable Wi-Fi capability for software downloads.

Pitfall

⚠️ Insufficient RAM or Storage can lead to sluggish performance and longer load times. Ensure your laptop meets or exceeds the minimum requirements.

3. GitHub Account Setup on macOS ​

πŸ‘€ Create a GitHub Account ​

Steps

  1. 🌐 Visit GitHub’s website.
  2. πŸ“ Click on Sign up and follow the prompts to create a free account.
  3. πŸ”‘ Choose a unique username and verify your email address.

πŸ”§ Configure Git for GitHub ​

Steps

  1. πŸ–₯️ Open your terminal and set up your Git configuration:

    bash
    git config --global user.name "Your GitHub Username"
    git config --global user.email "your-email@example.com"
  2. πŸ”‘ Generate an SSH Key for secure connection with GitHub:

    bash
    ssh-keygen -t ed25519 -C "your-email@example.com"
    • πŸ—‚οΈ Follow the prompts and save the key in the default location (~/.ssh/id_ed25519).
  3. πŸ›‘οΈ Start the SSH Agent and Add Your SSH Key:

    bash
    eval "$(ssh-agent -s)"
    ssh-add ~/.ssh/id_ed25519
  4. πŸ“‹ Copy the SSH Key to Your Clipboard:

    bash
    pbcopy < ~/.ssh/id_ed25519.pub

    (If pbcopy is not available, you can manually copy the key by opening the file: cat ~/.ssh/id_ed25519.pub and copying its contents.)

  5. 🌐 Add the SSH Key to GitHub:

    • Go to GitHub > Settings > SSH and GPG Keys > New SSH Key.
    • πŸ–±οΈ Paste the key from your clipboard and save it.

πŸ“‚ Clone a Repository to Test ​

Steps

  1. πŸ–₯️ In your terminal, clone a test repository to confirm your GitHub connection:
    bash
    git clone git@github.com:username/repository.git
    • πŸ”„ Replace username and repository with your GitHub details.

Verification:

βœ… Successfully cloning a repository confirms that Git and GitHub are correctly set up on your system.

4. VS Code Extensions for Python on macOS ​

Enhance your development experience by installing the following VS Code extensions:

πŸ› οΈ ExtensionπŸ“„ DescriptionπŸ”— Install Link
🐍 Python ExtensionProvides debugging, linting, and other features for Python development.Install
πŸ” GitLensEnhances Git functionality within VS Code for better version control management.Install
πŸ““ JupyterEnables interactive notebooks and data science work.Install
πŸ–ŒοΈ Python Black FormatterAutomates code formatting to adhere to Python's PEP 8 style guidelines.Install
🌐 Live ServerLaunches a local development server with live reload feature.Install

Steps

How to Install Extensions:

  1. πŸ–₯️ Open Visual Studio Code.
  2. πŸ“‚ Go to the Extensions view by clicking the Extensions icon on the sidebar or pressing Cmd+Shift+X.
  3. πŸ” Search for each extension by name and click Install.

Conclusion ​

πŸŽ‰ You are now set up with a robust Python development environment on macOS! This setup ensures you have all the necessary tools to write, manage, and version-control your Python projects efficiently. Happy coding!