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:
- π₯ Visit the Visual Studio Code website.
- π±οΈ Download the
.deb
or.rpm
package suitable for your Linux distribution. - π 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
- For Debian-based distributions (e.g., Ubuntu):
- β 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:
- π Open your terminal.
- π₯ 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
- For Debian-based distributions (e.g., Ubuntu):
- β
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.
- π₯ Add the deadsnakes PPA (for Ubuntu-based distributions) to access newer Python versions:bash
sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update
- π Install Python 3.13:bash
sudo apt install python3.13 python3.13-venv python3.13-dev
- β 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:
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
- π 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:
bashcat ~/.ssh/id_ed25519.pub | xclip -selection clipboard
(Ensure
xclip
is installed. If not, install it usingsudo apt install xclip
for Debian-based orsudo dnf install xclip
for Red Hat-based distributions.)π 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 Linux β
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
Ctrl+Shift+X
. - π 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!