Skip to content

Python Development Setup Guide for Linux ​

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

1. Software Requirements for Python Setup on Linux ​

πŸ–₯️ 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 .deb or .rpm package suitable for your Linux distribution.
  3. πŸ”„ Install the package:
    • For Debian-based distributions (e.g., Ubuntu):
      bash
      sudo dpkg -i code_*.deb
      sudo apt-get install -f
    • For Red Hat-based distributions (e.g., Fedora):
      bash
      sudo rpm -i code-*.rpm
  4. βž• Important: Ensure VS Code is added to your system's PATH for easier command-line access.

πŸ› οΈ GIT ​

Purpose: Version control system to track code changes.

Steps

Download and Install GIT:

  1. 🌐 Open your terminal.
  2. πŸ“₯ Install GIT using your package manager:
    • For Debian-based distributions (e.g., Ubuntu):
      bash
      sudo apt update
      sudo apt install git
    • For Red Hat-based distributions (e.g., Fedora):
      bash
      sudo dnf install git
  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. πŸ“₯ Add the deadsnakes PPA (for Ubuntu-based distributions) to access newer Python versions:
    bash
    sudo add-apt-repository ppa:deadsnakes/ppa
    sudo apt update
  3. πŸ”„ Install Python 3.13:
    bash
    sudo apt install python3.13 python3.13-venv python3.13-dev
  4. βž• Important: Set Python 3.13 as the default version if necessary:
    bash
    sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 1

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: A recent Linux distribution (e.g., Ubuntu 22.04+, Fedora 36+).
  • Processor: Intel i5 (8th Gen or newer) or AMD Ryzen 5 (3000 series or newer).
  • 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 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 Linux ​

πŸ‘€ 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
    cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard

    (Ensure xclip is installed. If not, install it using sudo apt install xclip for Debian-based or sudo dnf install xclip for Red Hat-based distributions.)

  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 Linux ​

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 Ctrl+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 Linux! This setup ensures you have all the necessary tools to write, manage, and version-control your Python projects efficiently. Happy coding!