DEV Community

Cover image for How to Set Up a Python Development Environment (VS Code + Git)
MD SAIDUL ISLAM
MD SAIDUL ISLAM

Posted on

How to Set Up a Python Development Environment (VS Code + Git)

🚀 How to Set Up a Python Development Environment (VS Code + Git)

So, you’ve decided to learn Python—great choice! 🎉 Now, let’s set up a proper coding environment to write, test, and manage Python projects efficiently.

Today, we’ll cover:
✅ Installing Python
✅ Setting up VS Code for Python
✅ Installing Git for version control
✅ Running your first Python script

Let’s get started!🚀

1️⃣ Install Python

First, you need to install Python on your system.

🔹 Download Python from the official site:
👉 Python Official Download

🔹 For Windows:

  1. Download and run the installer.

  2. Check "Add Python to PATH" before clicking "Install".

  3. Open Command Prompt and type:

python --version

If it shows the Python version, you’re good to go! ✅

🔹 For Mac/Linux:

Use Homebrew on Mac:

brew install python3
Enter fullscreen mode Exit fullscreen mode

On Linux (Debian/Ubuntu):

sudo apt install python3
Enter fullscreen mode Exit fullscreen mode

2️⃣ Install VS Code (Visual Studio Code)

Why VS Code?
✔️ Lightweight & Fast
✔️ Supports Python Extensions
✔️ Built-in Terminal & Git Support

🔹 Download & install VS Code:
👉 VS Code Official Site

🔹 Set Up Python in VS Code:

  1. Open VS Code and install the Python Extension

  2. Press Ctrl + Shift + P → Type Python: Select Interpreter → Choose Python 3.x

  3. Open a folder, create a .py file, and start coding!

3️⃣ Install & Set Up Git for Version Control

Version control helps you track changes in your code. Git is the most popular tool for this!

🔹 Download Git:
👉 Git Official Site

🔹 Basic Git Setup (After Installation)
Open a terminal and set up your identity:

git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"

🔹 Check if Git is Installed:

git --version
Enter fullscreen mode Exit fullscreen mode

If you see the version number, Git is ready! ✅

4️⃣ Run Your First Python Script

Now, let’s write and run your first Python script in VS Code.

🔹 Open VS Code, create a file named hello.py
🔹 Write this simple code:

print("Hello, World! Welcome to Python Development!")
Enter fullscreen mode Exit fullscreen mode

🔹 Run the script by clicking Run ▶️ or using the terminal:

python hello.py
Enter fullscreen mode Exit fullscreen mode

Congrats! 🎉 You’ve successfully set up Python, VS Code, and Git!

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

👋 Kindness is contagious

If this post resonated with you, feel free to hit ❤️ or leave a quick comment to share your thoughts!

Okay