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:
- π₯ Visit the Visual Studio Code website.
- π±οΈ Download the macOS installer (
.zip
file). - π Extract the downloaded
.zip
file. - β Important: Move the
Visual Studio Code.app
to theApplications
folder for easy access. - π οΈ (Optional): Install the
code
command in PATH by opening VS Code, pressingCmd+Shift+P
, typingshell command
, and selectingShell Command: Install 'code' command in PATH
.
π οΈ GIT β
Purpose: Version control system to track code changes.
Steps
Download and Install GIT:
- π Open your terminal.
- π₯ Install GIT using Homebrew:bash(If Homebrew is not installed, install it by following the instructions at Homebrew's official website.)
brew install git
- β
Verify the installation:bash
git --version
Verification:
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:
- π Open your terminal.
- π₯ Install Python 3.13 using Homebrew:bash
brew install python@3.13
- β Important: Ensure Python 3.13 is linked correctly:bash
brew link --force python@3.13
- π (Optional): Verify the installation path and add it to your shell profile if necessary.
Verification:
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
- π Visit GitHubβs website.
- π Click on Sign up and follow the prompts to create a free account.
- π Choose a unique username and verify your email address.
π§ Configure Git for GitHub β
Steps
π₯οΈ Open your terminal and set up your Git configuration:
bashgit config --global user.name "Your GitHub Username" git config --global user.email "your-email@example.com"
π Generate an SSH Key for secure connection with GitHub:
bashssh-keygen -t ed25519 -C "your-email@example.com"
- ποΈ Follow the prompts and save the key in the default location (
~/.ssh/id_ed25519
).
- ποΈ Follow the prompts and save the key in the default location (
π‘οΈ Start the SSH Agent and Add Your SSH Key:
basheval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519
π Copy the SSH Key to Your Clipboard:
bashpbcopy < ~/.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.)π 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
- π₯οΈ In your terminal, clone a test repository to confirm your GitHub connection:bash
git clone git@github.com:username/repository.git
- π Replace
username
andrepository
with your GitHub details.
- π Replace
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 Extension | Provides debugging, linting, and other features for Python development. | Install |
π GitLens | Enhances Git functionality within VS Code for better version control management. | Install |
π Jupyter | Enables interactive notebooks and data science work. | Install |
ποΈ Python Black Formatter | Automates code formatting to adhere to Python's PEP 8 style guidelines. | Install |
π Live Server | Launches a local development server with live reload feature. | Install |
Steps
How to Install Extensions:
- π₯οΈ Open Visual Studio Code.
- π Go to the Extensions view by clicking the Extensions icon on the sidebar or pressing
Cmd+Shift+X
. - π 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!